• Register
0 votes
142 views

Problem :

I have recently installed the opencv 2.4.8 . I am also using python 2.7. I have tried to add my opencv lib to the python according to the tutorial however when I wanted to import my opencv I encountered below error:

import cv2 RuntimeError: module compiled against API version 9 but this version

of numpy is 7 Traceback (most recent call last):

File "<pyshell#2>", line 1, in <module>

import cv2 ImportError: numpy.core.multiarray failed to import

 

I have already tried to update my scipy and numpy packages to the latest version, but still I got the above error. How can I fix above problem? I researched on still I am unable to find the solutions. Currently I use Windows 7.

7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I got the same error too in the recent past. Finally I figure out that I should update my numpy to the latest version.

The version of numpy mentioned in the tutorial is the version 7, but now the team is using the version 9 (but the numpy team name it as 1.8 publicly).

For yours convenience please check here to download the version that I use.

Also to download the latest version, please check here.

I hope it solves your issue.

38.6k points

Related questions

0 votes
1 answer 1.3k views
1.3k views
Problem : I am trying to execute below commands. import numpy as np import cv But I am getting following error on my console: >>> runfile('/Users/isaiahnields/.spyder2/temp.py', wdir='/Users/isaiahnields/.spyder2') RuntimeError: module compiled against API version a but this ... it is not working. I had added cv.py to the python2.7 folder in Spyder-Py2 is there anything else I need to add?
asked Dec 4, 2019 alecxe 7.5k points
0 votes
1 answer 6 views
6 views
Problem: Need an answer for this : Runtimeerror: module compiled against api version a but this version of numpy is 9
asked Jun 15 Chi Omega 168k points
0 votes
1 answer 1.4k views
1.4k views
Problem : I want to learn the Machine Learning but I am unabe to resolve below error. My Specs : · Mac High Sierra 10.13.2 · Python3.4.5 · Numpy1.13.3 Used below Command: $ python3 -c "import jupyter, matplotlib, numpy, pandas, scipy, sklearn" I am ... to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
asked Dec 4, 2019 alecxe 7.5k points
1 vote
1 answer 22 views
22 views
Problem: How can I solve this runtime error? Module compiled against API version 0xa but this version of numpy is 0x9.
asked Mar 30 PkGuy 25.9k points
0 votes
1 answer 8 views
8 views
Problem: Has anyone had this problem before : Runtimeerror: module compiled against api version 0xc but this version of numpy is 0xa?
asked Jun 13 Aurelia Maja 78.4k points
0 votes
1 answer 6 views
6 views
Problem: Can anyone help with this : Runtimeerror: module compiled against api version 0xc but this version of numpy is 0xb?
asked Jun 13 Priscilla Gurpreet 74.7k points
0 votes
1 answer 75 views
0 votes
1 answer 11 views
11 views
Problem: Opencv capture image from camera python?
asked Jul 22 Nahil 128k points