Home > OS >  How can I export module OpenCV via Pyinstaller if it is not imported in project?
How can I export module OpenCV via Pyinstaller if it is not imported in project?

Time:11-13

I created a Bot which uses pyautogui function locateOnScreen to detect certain things on my monitor. In this locateOnScreen function i use confidence parameter which is only possible because i installed OpenCV module via pip. To use this confidence parameter you only have to have opencv installed but do NOT have to import it in your project. Now if i want to make a executable via pyinstaller i get an error which says that there is no module OpenCV.

CodePudding user response:

I was two days over it.

"I found a solution! Turns out the current version of opencv (4.5.4.58) is not compatible with the current version of pyinstaller, I installed the previous version of opencv (4.5.3.56) and it worked!"

pip install opencv-python==4.5.3.56

I'm using PyInstaller to transform in exe.

  • Related