简体   繁体   English

使用python在opencv中加载DLL失败

[英]DLL load failed in opencv with python

I wish if anyone could give me a hand with my prob, I have installed python 3.6 amd64 and add it to path then installed opencv 3.2 successfully using "pip" ... However, when I'm trying to import the cv2 (the library of opencv) and here is the error that I have got:我希望如果有人可以帮我解决我的问题,我已经安装了 python 3.6 amd64 并将其添加到路径然后使用“pip”成功安装了 opencv 3.2 ......但是,当我尝试导入 cv2(库opencv),这是我得到的错误:

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

I'm guessing you've installed pip2(for python2) instead of pip3.(for python3) Try this to install pip for python3我猜你已经安装了 pip2(for python2) 而不是 pip3.(for python3) 试试这个来为 python3 安装 pip

sudo apt-get install python3-pip 

Now use现在使用

pip3 install python3-opencv

Make sure that cv2.pyd is in your Python's lib\\site-packages\\ directory.确保cv2.pyd位于Python's lib\\site-packages\\目录中。

Also check if OPENCV_DIR = C:\\Program Files\\OpenCV 3.2.0\\x64\\vc14 , or similar, is in your Windows' system variables setting.还要检查OPENCV_DIR = C:\\Program Files\\OpenCV 3.2.0\\x64\\vc14或类似文件是否在 Windows 的system variables设置中。 The sample path OPENCV_DIR is for the binary compiled with VC14 which is Visual Studio 2015 VC++ .示例路径OPENCV_DIR用于使用VC14编译的二进制文件,即Visual Studio 2015 VC++

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM