[英]cv2 ImportError: DLL load failed: The specified module could not be found
I'm working with opencv in my last study's project. 我在上一个研究项目中正在使用opencv。 I have python 2.7 and opencv 3.4 already installed.
我已经安装了python 2.7和opencv 3.4。 I developed my python project in windows 8 64 bit and I converted my application from .py to .exe through Pyinstaller and it's working fine .
我在Windows 8 64位上开发了python项目,并通过Pyinstaller将应用程序从.py转换为.exe,并且工作正常。
But when I move my application to the industrial machine which is windows xp pack 3 32bit and i try to import cv2 I get the following error : 但是,当我将应用程序移动到工业机器(即Windows XP Pack 3 32位)并且尝试导入cv2时,出现以下错误:
ImportError: DLL load failed: The specified module could not be found
Note that I have tried to install Microsoft visual c++ 2015 and didn't solve the problem . 请注意,我尝试安装Microsoft visual c ++ 2015并没有解决问题。
Can anyone help me ? 谁能帮我 ?
I had the same issue. 我遇到过同样的问题。 I solved it by placing two dlls in the same folder as my .exe file.
我通过将两个dll放在与我的.exe文件相同的文件夹中来解决此问题。 The dlls are "api-ms-win-downlevel-shlwapi-l1-1-0.dll" which can be downloaded from the internet and other one is "opencv_ffmpeg***_**.dll" which can be found in python site-packages if you have installed python-opencv via pip, where *** is the version and ** is 32 or 64 bit.
dll是可以从互联网上下载的“ api-ms-win-downlevel-shlwapi-l1-1-0.dll”,另一个是可以在python中找到的“ opencv_ffmpeg *** _ **。dll”如果已通过pip安装了python-opencv,则为站点软件包,其中***是版本,而**是32或64位。 After you have gathered these two files, compile the script using following options.
收集了这两个文件后,使用以下选项编译脚本。
pyinstaller -w script.py
Now place the two dlls in dist/your_folder/ where the .exe is located. 现在,将两个dll放在.exe所在的dist / your_folder /中。 Also be careful of all the warnings related to missing dlls while compiling, if you see any warning related to missing dlls, place that dll in .exe folder afterward.
还要在编译时注意与丢失dll相关的所有警告,如果您看到与丢失dll相关的任何警告,请将该dll放在.exe文件夹中。
Which version using for build opencv? 哪个版本用于构建opencv?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.