Install opencv in anaconda3

ⅰ亾dé卋堺 提交于 2019-12-24 07:33:18

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/41199408/install-opencv-in-anaconda3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!