Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'gaussian' from 'scipy.signal' #1354

Closed
dweindl opened this issue Apr 3, 2024 · 5 comments
Closed

ImportError: cannot import name 'gaussian' from 'scipy.signal' #1354

dweindl opened this issue Apr 3, 2024 · 5 comments
Assignees

Comments

@dweindl
Copy link
Member

dweindl commented Apr 3, 2024

e.g., https://github.com/ICB-DCM/pyPESTO/actions/runs/8534329173:

_________________ ERROR collecting test/sample/test_sample.py __________________
ImportError while importing test module '/home/runner/work/pyPESTO/pyPESTO/test/sample/test_sample.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/sample/test_sample.py:17: in <module>
    from pypesto.sample.pymc import PymcSampler
pypesto/sample/pymc.py:7: in <module>
    import arviz as az
.tox/base/lib/python3.9/site-packages/arviz/__init__.py:34: in <module>
    from .plots import *
.tox/base/lib/python3.9/site-packages/arviz/plots/__init__.py:2: in <module>
    from .autocorrplot import plot_autocorr
.tox/base/lib/python3.9/site-packages/arviz/plots/autocorrplot.py:7: in <module>
    from .plot_utils import default_grid, filter_plotters_list, get_plotting_function
.tox/base/lib/python3.9/site-packages/arviz/plots/plot_utils.py:15: in <module>
    from ..stats.density_utils import kde
.tox/base/lib/python3.9/site-packages/arviz/stats/__init__.py:3: in <module>
    from .density_utils import *
.tox/base/lib/python3.9/site-packages/arviz/stats/density_utils.py:8: in <module>
    from scipy.signal import convolve, convolve2d, gaussian  # pylint: disable=no-name-in-module
E   ImportError: cannot import name 'gaussian' from 'scipy.signal' (/home/runner/work/pyPESTO/pyPESTO/.tox/base/lib/python3.9/site-packages/scipy/signal/__init__.py)

Related to the recent scipy release

See also arviz-devs/arviz#2330

Nothing to be fixed in pypesto, but I guess others will run into this issue too...

@FFroehlich
Copy link
Contributor

Nothing to be fixed in pypesto, but I guess others will run into this issue too...

pin scipy until arviz publishes their next release?

@dweindl
Copy link
Member Author

dweindl commented Apr 3, 2024

pin scipy until arviz publishes their next release?

Can be done, yes. But I'd only do that for CI jobs then, not in setup.cfg. That latter would be annoying for people who are not even using arviz.

@dweindl
Copy link
Member Author

dweindl commented Apr 3, 2024

Nothing to be fixed in pypesto

On second thought: arviz isn't used anywhere in pypesto except for this type annotation?!?

self.data: Union[az.InferenceData, None] = None

EDIT: removing it there won't help, since it's still imported via pymc.

dweindl added a commit to dweindl/pyPESTO that referenced this issue Apr 3, 2024
dweindl added a commit to dweindl/pyPESTO that referenced this issue Apr 4, 2024
dweindl added a commit that referenced this issue Apr 5, 2024
@dweindl
Copy link
Member Author

dweindl commented Apr 5, 2024

pin scipy until arviz publishes their next release?

#1360

Leaving this issue open until there is a new arviz release and 5879755 can be reverted.

dweindl added a commit to dweindl/pyPESTO that referenced this issue Apr 17, 2024
@dweindl dweindl self-assigned this Apr 17, 2024
PaulJonasJost pushed a commit that referenced this issue Apr 18, 2024
@PaulJonasJost
Copy link
Collaborator

Closed with #1376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants