Skip to content

ImportError with arviz >= 1.0: module 'arviz' has no attribute 'InferenceData' #800

@twiecki

Description

@twiecki

CausalPy fails to import with arviz >= 1.0.

Error:

import causalpy as cp
# → AttributeError: module 'arviz' has no attribute 'InferenceData'

The error comes from pymc's util.py (line 244) which uses arviz.InferenceData as a type annotation. In arviz 1.0, InferenceData was moved to arviz-base and removed from the top-level arviz namespace.

Suggested fix: Pin arviz<1.0 in CausalPy's dependencies until pymc supports arviz 1.0.

Environment: Python 3.13, latest CausalPy from PyPI, arviz 1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions