Hello guys i ve just installed anaconda3 in windows 8.1 and opencv 2.4.13 and 3.1.0/ Ive copied from the file c:/..../opencv/build/python/2.7/x64/cv2.pyd and i pasted it to C:\Users.....\Anaconda3\Lib\site-packages. I ve pasted both for opencv 2.4.13 as cv2.pyd and for opencv 3.1.0 as cv2(3)pyd in order to change it when i want to use any of them. My system is 64-bit and i use jupyter notebook. When i run the command import cv2 it write me

ImportError Traceback (most recent call last)

in ()

----> 1 import cv2

In anaconda3 i use python3.5

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

解决方案

I might be missing something, but i believe you are just missing seting up the envi. variables.

Set Enviromental Variables

Right-click on "My Computer" (or "This PC" on Windows 8.1) -> left-click Properties -> left-click "Advanced" tab -> left-click "Environment Variables..." button.

Add a new User Variable to point to the OpenCV (either x86 for 32-bit system or x64 for 64-bit system.) I am currently on a 64-bit machine.

| 32-bit or 64 bit machine? | Variable | Value |

|---------------------------|--------------|--------------------------------------|

| 32-bit | OPENCV_DIR | C:\opencv\build\x86\vc12 |

| 64-bit | OPENCV_DIR | C:\opencv\build\x64\vc12 |

Append %OPENCV_DIR%\bin to the User Variable PATH.

For example, my PATH user variable looks like this...

Before:

C:\Users\Johnny\Anaconda;C:\Users\Johnny\Anaconda\Scripts

After:

C:\Users\Johnny\Anaconda;C:\Users\Johnny\Anaconda\Scripts;%OPENCV_DIR%\bin

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐