Ask Your Question
0

Windows install--cv2.pyd in right folder, but can't find dlls

asked 2016-06-22 16:09:19 -0600

brfoley76 gravatar image

I need to get OpenCV 3.x installed on a Windows 7 (x64) machine, for a Python cv2 project. I installed Anaconda, to get Python 2.7 with numpy. I installed cmake 2.8, and ran it on the newest source code from github (3.1). I ran Visual Studio 2012, and built opencv. Everything seems to install okay:


...
    7>  -- Up-to-date: C:/opencv/build/install/include/opencv2/videostab/wobble_suppression.hpp
    7>  -- Installing: C:/Anaconda/Lib/site-packages/cv2.pyd
    7>  -- Up-to-date: C:/opencv/build/install/etc/haarcascades/haarcascade_eye.xml
    7>  -- Up-to-date: C:/opencv/build/install/etc/haarcascades/haarcascade_eye_tree_eyeglasses.xml
...

(at least, it's putting the cv2.pyd file in the right place). When I try to import cv2 in python, though, all I get is an error message:


>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
>>>

I added the OpenCV path to the system environment, as C:\opencv\build\install\x64\vc11. But that didn't help. What am I missing?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-23 01:50:08 -0600

berak gravatar image

"I added the OpenCV path ..." - well your anaconda might have own ideas about path, environment and such.

try to rebuild it with cmake -DBUILD_SHARED_LIBS=OFF .

this should result in a fat (~10mb) cv2.pyd, which no more depends on opencv dlls at runtime. (you'll still need opencv_ffmpeg.dll )

edit flag offensive delete link more

Comments

Yes! Thank you. There were a lot of other (very different) problems I needed to troubleshoot to get it to finally install. But this worked for the .dll problem. Greatly appreciated.

brfoley76 gravatar imagebrfoley76 ( 2016-07-12 21:29:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-22 16:09:19 -0600

Seen: 1,548 times

Last updated: Jun 23 '16