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

Interop is not compatible with Numpy 2.0.0 #348

Closed
Aratz opened this issue Jul 10, 2024 · 0 comments · Fixed by #349
Closed

Interop is not compatible with Numpy 2.0.0 #348

Aratz opened this issue Jul 10, 2024 · 0 comments · Fixed by #349
Labels

Comments

@Aratz
Copy link

Aratz commented Jul 10, 2024

Numpy 2.0.0 was released a few weeks ago and it breaks interop.

Steps to reproduce

  1. With python 3.10, run pip install interop
  2. Test the installation: python -m interop --test

Expected results

the tests pass

Actual results

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.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 "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/tmp/.venv/lib/python3.10/site-packages/interop/__init__.py", line 11, in <module>
    from interop.core import *
  File "/tmp/.venv/lib/python3.10/site-packages/interop/core.py", line 55, in <module>
    import interop.py_interop_run_metrics as interop_metrics
  File "/tmp/.venv/lib/python3.10/site-packages/interop/py_interop_run_metrics.py", line 13, in <module>
    from . import _py_interop_run_metrics
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/tmp/.venv/lib/python3.10/site-packages/interop/__init__.py", line 11, in <module>
    from interop.core import *
  File "/tmp/.venv/lib/python3.10/site-packages/interop/core.py", line 55, in <module>
    import interop.py_interop_run_metrics as interop_metrics
  File "/tmp/.venv/lib/python3.10/site-packages/interop/py_interop_run_metrics.py", line 13, in <module>
    from . import _py_interop_run_metrics
ImportError: numpy.core.multiarray failed to import

Proposed solution

As suggested in the error message, numpy should be pinned in the installation script, or interop should be made compatible with numpy 2.0

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

Successfully merging a pull request may close this issue.

2 participants