Skip to content

Conversation

@patricefortin
Copy link
Collaborator

@patricefortin patricefortin commented Jan 22, 2026

With the latest release of scipy (v1.17.0), a method has been removed. The mne version we depend on requires that function but does not pin the scipy version in its dependency.

As a temporary fix (until dependencies are fixed in mne), we limit the upgrade of scipy.

2 ways to reproduce the bug:

Method 1) update hypyp with poetry to the latest version of packages

$ poetry update
Updating dependencies
Resolving dependencies... (9.4s)

Package operations: 0 installs, 1 update, 0 removals

  - Updating scipy (1.16.3 -> 1.17.0)

Writing lock file
$ poetry run python -c 'import hypyp'

Method 2) simply install the latest version from pypi:

$ mkdir -p '/tmp/foo' \
  cd /tmp/foo \
  uv init \
  uv add hypyp \
  uv run python -c 'import hypyp'
  
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/foo/.venv/lib/python3.12/site-packages/hypyp/__init__.py", line 2, in <module>
    from hypyp import analyses, prep, stats, utils, viz
  File "/tmp/foo/.venv/lib/python3.12/site-packages/hypyp/analyses.py", line 30, in <module>
    from mne.time_frequency import EpochsSpectrum
  File "/tmp/foo/.venv/lib/python3.12/site-packages/lazy_loader/__init__.py", line 82, in __getattr__
    submod = importlib.import_module(submod_path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pfortin/.pyenv/versions/3.12.11/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/foo/.venv/lib/python3.12/site-packages/mne/time_frequency/spectrum.py", line 13, in <module>
    from ..channels.channels import UpdateChannelsMixin
  File "/tmp/foo/.venv/lib/python3.12/site-packages/mne/channels/channels.py", line 55, in <module>
    from ..bem import _check_origin
  File "/tmp/foo/.venv/lib/python3.12/site-packages/mne/bem.py", line 41, in <module>
    from .surface import (
  File "/tmp/foo/.venv/lib/python3.12/site-packages/mne/surface.py", line 32, in <module>
    from .transforms import (
  File "/tmp/foo/.venv/lib/python3.12/site-packages/mne/transforms.py", line 17, in <module>
    from scipy.special import sph_harm
ImportError: cannot import name 'sph_harm' from 'scipy.special' (/tmp/foo/.venv/lib/python3.12/site-packages/scipy/special/__init__.py). Did you mean: 'sph_harm_y'?

This will yield the same error.

Here is the commit in scipy repository scipy/scipy@39b8d4d

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

Successfully merging this pull request may close these issues.

2 participants