Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

opencv - ImportError: DLL load failed while importing cv2 with pyinstaller

I have installed OpenCV from source. I can import it in Spyder editor, and run object detection models using cmd windows. I want to create an exe file from my python code. Initially, I got config.py file not found when running my exe file. Then, when I use print(cv2.file), I get the following path:

C:/Users/simin/anaconda3/Lib/site-packages/cv2python-3.8cv2.cp38-win_amd64.pyd So, I used the following command for creating the exe file:

pyinstaller --onefile untitled3.py --paths "C:Userssiminanaconda3Libsite-packagescv2python-3.8" Now, the above error does not appear. However, I get "ImportError: DLL load failed while importing cv2: The specified module could not be found" error. Does anyone know how I can solve this issue? Version of Python 3.8 installed using anaconda, OpenCV version 4.4.0 installed using cmake (from source). Thank you in advance for your help.

question from:https://stackoverflow.com/questions/66054418/importerror-dll-load-failed-while-importing-cv2-with-pyinstaller

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...