Bug 2332408 - scipy compiled using NumPy 1.x cannot be run with NumPy 2
Summary: scipy compiled using NumPy 1.x cannot be run with NumPy 2
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: scipy
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Nikola Forró
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: NUMPY2
TreeView+ depends on / blocked
 
Reported: 2024-12-14 19:10 UTC by Miro Hrončok
Modified: 2024-12-16 09:24 UTC (History)
7 users (show)

Fixed In Version: scipy-1.14.1-2.fc42
Clone Of:
Environment:
Last Closed: 2024-12-16 09:24:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources scipy pull-request 50 0 None None None 2024-12-14 23:43:50 UTC

Description Miro Hrončok 2024-12-14 19:10:54 UTC
Some (most?) scipy modules cannot be used with NumPy 2:

python3-scipy-1.14.1-1.fc42.x86_64
python3-numpy-2.2.0-1.fc42.x86_64

Reproducible: Always

Steps to Reproduce:
>>> import scipy.ndimage as ndimage

Actual Results:  
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python3.13/_pyrepl/__main__.py", line 6, in <module>
    __pyrepl_interactive_console()
  File "/usr/lib64/python3.13/_pyrepl/main.py", line 59, in interactive_console
    run_multiline_interactive_console(console)
  File "/usr/lib64/python3.13/_pyrepl/simple_interact.py", line 160, in run_multiline_interactive_console
    more = console.push(_strip_final_indent(statement), filename=input_name, _symbol="single")  # type: ignore[call-arg]
  File "/usr/lib64/python3.13/code.py", line 314, in push
    more = self.runsource(source, filename, symbol=_symbol)
  File "/usr/lib64/python3.13/_pyrepl/console.py", line 211, in runsource
    self.runcode(code)
  File "/usr/lib64/python3.13/code.py", line 92, in runcode
    exec(code, self.locals)
  File "<python-input-0>", line 1, in <module>
    import scipy.ndimage as ndimage
  File "/usr/lib64/python3.13/site-packages/scipy/ndimage/__init__.py", line 152, in <module>
    from ._filters import *
  File "/usr/lib64/python3.13/site-packages/scipy/ndimage/_filters.py", line 39, in <module>
    from . import _nd_image
Traceback (most recent call last):
  File "/usr/lib64/python3.13/site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.


Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import scipy.ndimage as ndimage
  File "/usr/lib64/python3.13/site-packages/scipy/ndimage/__init__.py", line 152, in <module>
    from ._filters import *
  File "/usr/lib64/python3.13/site-packages/scipy/ndimage/_filters.py", line 39, in <module>
    from . import _nd_image
ImportError: numpy.core.multiarray failed to import


Expected Results:  
import suceeds

numpy 2 landed recently via https://fedoraproject.org/wiki/Changes/NumPy2 but there were apparently no rebuilds of dependent packages.

Comment 1 Orion Poplawski 2024-12-14 23:02:08 UTC
koschei shows a test failure with numpy 2.0: https://koschei.fedoraproject.org/package/scipy

I've filed https://src.fedoraproject.org/rpms/scipy/pull-request/50 which hopefully fixes that.  If that build I'll merge and build unless someone else gets to it first.


Note You need to log in before you can comment on or make changes to this bug.