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

mthree 2.6.3 wheel raises an error with numpy 2 #212

Closed
t-imamichi opened this issue Aug 30, 2024 · 2 comments
Closed

mthree 2.6.3 wheel raises an error with numpy 2 #212

t-imamichi opened this issue Aug 30, 2024 · 2 comments

Comments

@t-imamichi
Copy link
Member

t-imamichi commented Aug 30, 2024

  • mthree version: 2.6.3 (installed via pip)
  • numpy version: 2.1.0
  • python version: 3.12.5
  • OS: macOS 14.6.1

Importing mthree raises the following error. mthree should add a constraint numpy<2 or compile cython with numpy 2.

import mthree

output

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.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 "/Users/ima/tasks/4_2024/qiskit/mthree/tmp/import.py", line 1, in <module>
    import mthree
  File "/Users/ima/tasks/4_2024/qiskit/mthree/.venv/lib/python3.12/site-packages/mthree/__init__.py", line 31, in <module>
    from .mitigation import M3Mitigation
  File "/Users/ima/tasks/4_2024/qiskit/mthree/.venv/lib/python3.12/site-packages/mthree/mitigation.py", line 35, in <module>
    from mthree.matrix import _reduced_cal_matrix, sdd_check
Traceback (most recent call last):
  File "/Users/ima/tasks/4_2024/qiskit/mthree/tmp/import.py", line 1, in <module>
    import mthree
  File "/Users/ima/tasks/4_2024/qiskit/mthree/.venv/lib/python3.12/site-packages/mthree/__init__.py", line 31, in <module>
    from .mitigation import M3Mitigation
  File "/Users/ima/tasks/4_2024/qiskit/mthree/.venv/lib/python3.12/site-packages/mthree/mitigation.py", line 35, in <module>
    from mthree.matrix import _reduced_cal_matrix, sdd_check
  File "mthree/matrix.pyx", line 1, in init mthree.matrix
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).
@t-imamichi t-imamichi changed the title mthree wheel raises an error with numpy 2 mthree 2.6.3 wheel raises an error with numpy 2 Aug 30, 2024
@nonhermitian
Copy link
Collaborator

Yes, we will have to build against NumPy 2+ to support both. This should be completed when I solve #211

@nonhermitian
Copy link
Collaborator

This is closed by #217 and should go out in the next release

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

2 participants