Val
Val

Reputation: 325

issues with python executable from pyinstaller

I created an exe with pyinstaller (I'm using python 3.7.6 and pyinstaller 3.6) using

pyinstaller --onefile --icon=icon.ico my_script.py

(the problem is the same even with pyinstaller --onedir --icon=icon.ico my_script.py)

the exe is built fine, but I get multiple errors along the way:

25484 INFO: Excluding import 'PyQt5'
25486 INFO:   Removing import of PyQt5 from module PIL.ImageQt
25487 INFO: Import to be excluded not found: 'FixTk'
25488 INFO: Excluding import 'tkinter'
25490 INFO:   Removing import of tkinter from module PIL.ImageTk
25491 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
25496 INFO: Excluding import 'tkinter'
25498 INFO: Import to be excluded not found: 'FixTk'
25499 INFO: Loading module hook "hook-pkg_resources.py"...
26227 INFO: Processing pre-safe import module hook   win32com
26524 INFO: Excluding import '__main__'
26525 INFO:   Removing import of __main__ from module pkg_resources

despite of these errors, the exe works fine on some computers, and on some of them don't. Where it doesn't work I get this error at startup:

Traceback (most recent call last):
  File "my_script.py", line 39, in <module>
  File "c:\users\valerio\appdata\local\programs\python\python37-32\lib\site-pack
ages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\cv2\__init__.py", line 3, in <module>
ImportError: DLL load failed: The specified module could not be found.
[2800] Failed to execute script my_script

so my questions are:

  1. why am I getting the built errors?

  2. why on some computer is working fine and some dont's?? this second question is really driving me crazy..

thank you

Upvotes: 0

Views: 1107

Answers (1)

Val
Val

Reputation: 325

I found the answer to my problem. I write it here in case anyone needs it. the problem is just on windows server 2008 and 2012. They are missing a module called "desktop experience".

Once installed it (for example with this guide) the error will disappear.

Another similar discussion

Upvotes: 1

Related Questions