Ask Your Question

Visual studio 2013 can't import cv2

asked 2016-04-21 08:18:39 -0500

I tried to follow this link to compile opencv on visual studio 2013 :

However, I got this error when I run import cv2 command on python IDLE:

ImportError: DLL load failed: The specified module could not be found.

Can anyone tell me how to solve this problem?

edit retag flag offensive close merge delete


  • did you build the INSTALL project ? (this should make the python bindings & copy them to your site-packages folder)

  • is there a cv2.pyd in your python/lib/site-packages ?

  • try from a plain cmdline, not IDLE.
berak gravatar imageberak ( 2016-04-21 09:06:06 -0500 )edit

yes, I build the INSTALL, and cv2.pyd also exists in my python/lib/site-packages folder. my python version is 2.7.10

billcyz gravatar imagebillcyz ( 2016-04-21 16:58:27 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-02-02 23:25:21 -0500

I had the same issue, but found a solution that worked for me.

After building INSTALL in Visual Studio 2013, I had to add this to my System path variable.
(location to your opencv directory)\build\bin\Release

After that, I was able to open the python command line or python IDLE and "import cv2" worked. I hope that this helps.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-04-21 08:18:39 -0500

Seen: 810 times

Last updated: Feb 02 '17