Python windows, ImportError: DLL load failed: 找不到指定的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32671918/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
windows, ImportError: DLL load failed: The specified module could not be found
提问by Jahid Rahman
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('12.jpg',0)
orb = cv2.ORB()
kp = orb.detect(img,None)
kp, des = orb.compute(img, kp)
img2 = cv2.drawKeypoints(img,kp,color=(0,255,0), flags=0)
plt.imshow(img2),plt.show()
I have added the numpy
and cv2
modules to my python directory and set their environment variables.
我已将numpy
和cv2
模块添加到我的 python 目录并设置它们的环境变量。
I also installed msvcp71.dll
and msvcr71.dll
, but this error has not solved.
我也安装了msvcp71.dll
and msvcr71.dll
,但是这个错误没有解决。
So how can i fix this kind of dll problem?
那么我该如何解决这种 dll 问题呢?
Version information:
版本信息:
Python 3.2
numpy-1.6.1-win32-superpack-python3.2
opencv-3.0.0
蟒蛇 3.2
numpy-1.6.1-win32-superpack-python3.2
opencv-3.0.0
回答by zhangxaochen
I suspect you've mixed a x64python
with x86cv2.pyd
file, or vice versa. Simple way is to install a right version of opencv here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
我怀疑您将x64python
与x86cv2.pyd
文件混合在一起,反之亦然。简单的方法是在此处安装正确版本的 opencv:http: //www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
See discussions here:
请参阅此处的讨论:
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there
- How to use OpenCV in Python?
To check your python
arch:
检查您的python
足弓:
In [2]: import platform
In [3]: platform.architecture()
Out[3]: ('64bit', 'WindowsPE')
and cv2.pyd
:
I suggest using PESnoop:
和cv2.pyd
:我建议使用PESnoop:
D:\Anaconda\Lib\site-packages> PESnoop cv2.pyd /pe_dh
-------------------------------------------------------------------------------
PESnoop 2.0 - Advanced PE32/PE32+/COFF OBJ,LIB command line dumper by yoda
-------------------------------------------------------------------------------
Dump of file: cv2.pyd...
Modus: 64bit Portable Executable Image...
discussions:
讨论:
https://serverfault.com/questions/29958/how-to-tell-if-a-windows-application-requires-64-bit
How can I determine for which platform an executable is compiled?
https://serverfault.com/questions/29958/how-to-tell-if-a-windows-application-requires-64-bit