Mohamed LOUATI
Mohamed LOUATI

Reputation: 49

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

I'm working with opencv in my last study's project. I have python 2.7 and opencv 3.4 already installed. 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 .

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 :

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 .

Can anyone help me ?

Upvotes: 2

Views: 2048

Answers (2)

adeelz92
adeelz92

Reputation: 489

I had the same issue. I solved it by placing two dlls in the same folder as my .exe file. 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. 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. 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.

Upvotes: 2

Zheka Koval
Zheka Koval

Reputation: 535

Which version using for build opencv?

Upvotes: 0

Related Questions