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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…