0

Whenever I try to import OpenCV in python 2.7 it gives me the error:

import cv2
ImportError: DLL load failed: %1 is not a valid Win32 application (When using 

the x64 version), and when I use the x86 version I get

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

also, when I try to import numpy.core.multiarray, it says:

the API was compiled against numpy version 9 but you have version 7
AttributeError: 'module' object has no attribute 'core'

I am using Windows 10 & OpenCV 2.4.11 (I tried opencv 3.0.0 but it gives the same error) & I used this guide to install opencv http://opencvpython.blogspot.co.uk/2012/05/install-opencv-in-windows-for-python.html

5
  • The error-message is very clear: you have an outdated numpy version. Commented Feb 16, 2016 at 16:30
  • I don't know how to update it though... I have tried going on to sourceforge and getting the latest installer and then using that, but it still gives the same error. Also pip install numpy --upgrade does nothing. Thanks for helping @deets Commented Feb 16, 2016 at 19:27
  • I am using Numpy 1.6.1 as returned by numpy.__version__ @deets Commented Feb 16, 2016 at 19:40
  • See here: stackoverflow.com/questions/20999939/… - you need Numpy 1.8 Commented Feb 16, 2016 at 19:42
  • Thanks so much! It worked! Maybe you'll want to write an answer so I can mark it as accepted. You'll probably get some reputation as well @deets Commented Feb 16, 2016 at 19:55

1 Answer 1

0

If anything doesn't work, what the main cause can be is that you should download the 32-bit version of OpenCV (3.x) and Python (2.x) because NumPy is not available in a 64-bit version as of now (2016-07-06). You can visit Install OpenCV-Python in Windows (for Windows; for another OS reach the page a step behind).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.