'collections' has not attribute 'Iterable'
See original GitHub issueTesting 0.9.19
, while executing a doit
, I got the following error:
File "dns/env/bin/octodns-sync", line 8, in <module>
sys.exit(main())
File "dns/env/lib/python3.10/site-packages/octodns/cmds/sync.py", line 64, in main
manager.sync(
File "dns/env/lib/python3.10/site-packages/octodns/manager.py", line 611, in sync
total_changes += target.apply(plan)
File "dns/env/lib/python3.10/site-packages/octodns/provider/base.py", line 253, in apply
self._apply(plan)
File "dns/env/lib/python3.10/site-packages/octodns_ns1/__init__.py", line 1558, in _apply
getattr(self, f'_apply_{class_name}')(ns1_zone, change)
File "dns/env/lib/python3.10/site-packages/octodns_ns1/__init__.py", line 1506, in _apply_Create
self._client.records_create(zone, domain, _type, **params)
File "dns/env/lib/python3.10/site-packages/octodns_ns1/__init__.py", line 107, in call
new_record = func(self, zone, domain, _type, **params)
File "dns/env/lib/python3.10/site-packages/octodns_ns1/__init__.py", line 234, in records_create
return self._try(self._records.create, zone, domain, _type, **params)
File "dns/env/lib/python3.10/site-packages/octodns_ns1/__init__.py", line 261, in _try
return method(*args, **kwargs)
File "dns/env/lib/python3.10/site-packages/ns1/rest/records.py", line 115, in create
body = self._buildBody(zone, domain, type, **kwargs)
File "dns/env/lib/python3.10/site-packages/ns1/rest/records.py", line 101, in _buildBody
body["answers"] = self._getAnswersForBody(kwargs["answers"])
File "dns/env/lib/python3.10/site-packages/ns1/rest/records.py", line 43, in _getAnswersForBody
elif not isinstance(answers, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'
I returned to the older version 0.9.17
, and the error persists. From a quick search, it looks like collections.Iterable
has been deprecated, and now removed. It was replaced with collections.abc.Iterable
.
This looks to be a python 3.10.6
issue? I rebuilt my virtualenv with python 3.9.13
, and it functioned as expected.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
module 'collections' has no attribute 'Iterable' when I try to ...
I get a AttributeError: module 'collections' has no attribute 'Iterable' when I try to install libraries using PIP ; add specific python and...
Read more >AttributeError: module collections has no attribute Iterable
To solve the AttributeError: module collections has no attribute Iterable error, import the `Iterable` class from `collections.abc`, as a change was made in ......
Read more >AttributeError: module 'collections' has no attribute 'Iterable ...
On python 3.10 File "/home/alberto/.local/lib/python3.10/site-packages/dicttoxml.py", line 235, in convert_dict elif isinstance(val, collections.Iterable): ...
Read more >Run.py error; module 'collections' has no attribute 'Iterable'
Hi,. I use an virtual environment and finally install requirments.txt, but it has the following errors when execute “python run.py”
Read more >AttributeError: module 'collections' has no attribute 'Iterable'
Bug Description. the collections module has deprecated (and now removed) the "Iterable" class, the correct way of importing it in python3 is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This appears to be the issue related: https://github.com/ns1/ns1-python/issues/108 Pinning to the SHA solved the problem. I will inquire with
ns1-python
about a new version bump. Thank you.The problem is actually in https://github.com/ns1/ns1-python/, rather than octodns/octodns-ns1.
It looks like @istr actually fixed the underlying issue ~2 weeks ago in https://github.com/ns1/ns1-python/pull/107, specifically https://github.com/ns1/ns1-python/pull/107/files#diff-46d1e6289881ceb01279f697ff44b91f4f0b22abf467f8bfa709397cc51f4a19
Doesn’t looks like there’s been any releases since that merge so it’d only be available if you pin a SHA rather than release. https://github.com/ns1/ns1-python/tags