ijmbarr / causalgraphicalmodels

Causal Graphical Models in Python
MIT License
240 stars 44 forks source link

ImportError: cannot import name 'Iterable' from 'collections' #5

Open t-tte opened 2 years ago

t-tte commented 2 years ago

When using Python version 3.9 and later,

from causalgraphicalmodels import CausalGraphicalModel

results in

ImportError: cannot import name 'Iterable' from 'collections'

The following fix is described here:

try:
    # Python <= 3.9
    from collections import Iterable
except ImportError:
    # Python > 3.9
    from collections.abc import Iterable
EAly commented 2 years ago

I'm getting the same import error for Python 3.10 I tried to run from collections.abc import Iterable before from causalgraphicalmodels import CausalGraphicalModel but I still get the same error