question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'collections' has not attribute 'Iterable'

See original GitHub issue

Testing 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:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
brianeclowcommented, Aug 15, 2022

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.

0reactions
rosscommented, Aug 15, 2022

Shall I close this issue and reopen in the octodns-ns1 repo?

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found