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: numpy.core.multiarray failed to import #57

Closed
LukasBommes opened this issue Oct 27, 2024 · 1 comment
Closed

ImportError: numpy.core.multiarray failed to import #57

LukasBommes opened this issue Oct 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@LukasBommes
Copy link
Owner

LukasBommes commented Oct 27, 2024

When installing the Python package for release 1.0.6 with python -m pip install motion-vector-extractor in a fresh Python3.10 environment and then running extract_mvs -h you may get this error:

RuntimeError: module compiled against ABI version 0x1000009 but this version of numpy is 0x2000000
Traceback (most recent call last):
  File "/home/lukas/experiments/installmvs/env/bin/extract_mvs", line 5, in <module>
    from mvextractor.__main__ import main
  File "/home/lukas/experiments/installmvs/env/lib/python3.10/site-packages/mvextractor/__main__.py", line 8, in <module>
    import cv2
  File "/home/lukas/experiments/installmvs/env/lib/python3.10/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

The issue is that numpy 2, which was released in June 2024, is not ABI-compatible with numpy 1. This means code that was built against numpy 1 does not work with numpy 2 as a runtime dependency. To support numpy 2 as a runtime dependency, code has to be built against numpy 2. For details see here.

To prevent this bug I would have had to timely rebuild the source against numpy 2, which I didn't do.
With release 1.1.0 of the motion-vector-extractor this problem is now resolved.

@LukasBommes LukasBommes added the bug Something isn't working label Oct 27, 2024
@LukasBommes
Copy link
Owner Author

LukasBommes commented Oct 28, 2024

As an additional note: Release 1.0.6 still functions properly once you manually downgrade to numpy 1.x after the installation of motion-vector-extractor 1.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant