Skip to content

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

@t-tte

Description

@t-tte

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions