Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with CV2 : numpy.core.multiarray failed to import

Tags:

python

numpy

Tried to solve it with :

pip install -U numpy

but it still does not work.

That is what the console shows to me when I try to run the application :

    RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
  File "/Users/Rubio/Desktop/logistic-regression/train.py", line 8, in <module>
    import cv2
  File "/Library/Python/2.7/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import
like image 541
KiririIG Avatar asked Sep 09 '18 11:09

KiririIG


People also ask

How do I fix NumPy core Multiarray failed to import?

The problem is that you might have created a file called numpy.py. This file might coincide with numpy library. So, delete that numpy.py file and the problem gets solved.

What is the latest version of NumPy?

NumPy 1.21. 0 (release notes) – 22 Jun 2021. NumPy 1.20. 3 (release notes) – 10 May 2021.


1 Answers

Uninstall & Install Numpy

conda uninstall numpy

conda install -c conda-forge numpy

it works

like image 161
DoEvent Avatar answered Nov 15 '22 01:11

DoEvent