Getting error "A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.1 as it may crash" in 4.12.0.88
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- numpy, python
- Ambito
- build-system, computer-vision
Direzione di ricerca
Inizia dalla riproduzione opencv-install-failure-repro collegata ed esegui uv run main.py usando NumPy 2.x e la versione del pacchetto 4.12.0.88. Traccia il fallimento di import cv2 e la configurazione della wheel o della build generata. Il lavoro è completato quando la riproduzione segnalata importa cv2 correttamente con NumPy 2.x senza richiedere un downgrade a NumPy 1.x.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am trying to install the latest version (4.12.0.88) with numpy 2.x but I get the following error saying the module is not compiled with 1.x.
If I understand correctly, 4.12.0.88 supports numpy 2.x. Can someone give my advice on how I can fix this issue without downgrading numpy to 1.x?
$ uv run main.py
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 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 "/home/pi/developer/opencv-install-failure-repro/main.py", line 1, in <module>
import cv2
File "/home/pi/developer/opencv-install-failure-repro/.venv/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/home/pi/developer/opencv-install-failure-repro/.venv/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File "/home/pi/developer/opencv-install-failure-repro/main.py", line 1, in <module>
import cv2
File "/home/pi/developer/opencv-install-failure-repro/.venv/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/home/pi/developer/opencv-install-failure-repro/.venv/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import
- Lingua principale
- Python
- Stelle
- 5.4k
- Fork
- 1k
- Merge medio
- 22h 17m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opencv/opencv-python
-
[DOC] README file Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
opencv/opencv-python#1217 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opencv/opencv-python#1165 · 2 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
opencv/opencv-python#1273 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
opencv/opencv-python#1272 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
opencv/opencv-python#1268 · 1 commento ·
Tutte le issue di opencv/opencv-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
zostera/django-bootstrap4#894 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
use-agent-os/agent-os#3276 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NousResearch/hermes-agent#117848 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zilliztech/memsearch#759 ·