Skip to content

Cannot import petab.v2 without scipy installed #483

@sebapersson

Description

@sebapersson

Without scipy installed on version 0.8.2, the following error occurs when running:

import petab.v2

Stacktrace:

Traceback (most recent call last):
  File "<python-input-4>", line 1, in <module>
    import petab.v2
  File ".../petab/v2/__init__.py", line 7, in <module>
    from petab.v1.distributions import *  # noqa: F401, E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../petab/v1/distributions.py", line 18, in <module>
    from scipy.stats import (
    ...<8 lines>...
    )
ModuleNotFoundError: No module named 'scipy'

I am not a Python expert, but I guess scipy should either be listed as a required dependency, or the import should be made lazy so it is only needed when the relevant functionality is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions