I was trying to run pycprops in Python 3.10.2 (which uses astrodendro) and encountered the following import error (partial traceback to exclude my scripts and directory names):
File ".../astrodendro/__init__.py", line 3
from .dendrogram import Dendrogram, periodic_neighbours
File ".../astrodendro/dendrogram.py", line 8
from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections'
It looks like importing Iterable from collections has changed after Python 3.9 (see text below the first table at the top of the page here).
Changing line 8 in dendrogram.py from
from collections import Iterable
to
try:
# Python <= 3.9
from collections import Iterable
except ImportError:
# Python > 3.9
from collections.abc import Iterable
eliminated the problem for me (inspired by suggestion in the comment here).
I was trying to run
pycprops
in Python 3.10.2 (which usesastrodendro
) and encountered the following import error (partial traceback to exclude my scripts and directory names):It looks like importing
Iterable
fromcollections
has changed after Python 3.9 (see text below the first table at the top of the page here).Changing line 8 in
dendrogram.py
fromto
eliminated the problem for me (inspired by suggestion in the comment here).
Let me know if you need any more information.