Ask Your Question
0

Import cv2 error

asked 2015-03-01 03:33:08 -0600

kv36 gravatar image

i'm getting this error when i type import cv2 on the python idle. Don't know what to do. Please help

Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> import cv2 ImportError: DLL load failed: %1 is not a valid Win32 application.

edit retag flag offensive close merge delete

Comments

there are two cv2.pyd in the opencv/build/python/2.7 folder.One is x64 and the other is x86. Which one to copy? But both are showing errors

kv36 gravatar imagekv36 ( 2015-03-01 03:38:49 -0600 )edit

You need the x86 since the error clearly stated that it needs a 32 bit application. Did you built the source yourself?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-01 04:48:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-12-10 13:02:40 -0600

mista_odd gravatar image

I might be late on this but still I want to post this here as references for those after me.

I faced this problem few ours ago, the cv2.pyd from folder x64 gave me the exact error as stated above. so I tried the one from folder x86 and it gave me something sounds like the cv2.pyd is compiled for version 9 while my installed numpy is version 7. so I did some google and found numpy version 10.1 (http://sourceforge.net/projects/numpy...) and so I reinstall the numpy with latest version and everything works fine.

*ps: you might want to update matplotlib as well while you are at it. (http://sourceforge.net/projects/matpl...)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-03-01 03:33:08 -0600

Seen: 5,237 times

Last updated: Mar 01 '15