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 “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1tut2.py”, line 8, in
import imutils
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagesimutils_init_.py”, line 8, in
from .convenience import translate
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagesimutilsconvenience.py”, line 6, in
import cv2
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagescv2_init_.py”, line 181, in
bootstrap()
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagescv2_init_.py”, line 153, in bootstrap
native_module = importlib.import_module(“cv2”)
File “C:Program FilesPython312Libimportlib_init_.py”, line 90, in import_module
return bootstrap.gcd_import(name[level:], package, level)
AttributeError: ARRAY_API not found
Traceback (most recent call last):
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1tut2.py”, line 8, in
import imutils
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagesimutils_init.py”, line 8, in
from .convenience import translate
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagesimutilsconvenience.py”, line 6, in
import cv2
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagescv2_init.py”, line 181, in
bootstrap()
File “C:UsersmohitOneDriveDesktopFront EndFlaskpythonProject1.venvLibsite-packagescv2_init.py”, line 153, in bootstrap
native_module = importlib.import_module(“cv2”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Program FilesPython312Libimportlib_init_.py”, line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import
I was trying to make a flask app that uses cv2 and imutils libraries of python in Pycharm. But there seems to be a problem in Pycharm.
The error seems to be on the lines of import statement :
import imutils
import cv2
I watched a tutorial online about how to download cv2 and imutils , but even after downloading there seems to be a problem.
The error is about the upgraded version of Numpy which I don’t understand why it is happening , as I am not using Numpy.
Still I upgraded the version of Numpy but It does not work.
Can anybody help me with this ?
Mohit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.