3

so I have been using Pyinstaller the last couple of months to package and distribute my applications as single exe files, however I recently made the switch from using Tkinter in my GUI apps to using PySide2 (QT5 Wrapper). The thing is, I'm not able to package those executables, as I'm getting the following error at runtime:

Exception: [Errno 2] No such file or directory: 'C:\\support\\signature\\loader.py'
Traceback (most recent call last):
  File "pyscript", line 23, in bootstrap
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\support\\signature\\loader.py'
AttributeError: module 'signature_loader' has no attribute 'pyside_type_init'
SystemError: could not initialize part 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "C:\Users\felip\AppData\Roaming\Python\Python37\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "pkg_resources\__init__.py", line 33, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "C:\Users\felip\AppData\Roaming\Python\Python37\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "platform.py", line 116, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "C:\Users\felip\AppData\Roaming\Python\Python37\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "subprocess.py", line 50, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "C:\Users\felip\AppData\Roaming\Python\Python37\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "signal.py", line 45, in <module>
  File "c:\program files\python37\lib\functools.py", line 54, in update_wrapper
    value = getattr(wrapped, attr)
SystemError: <method-wrapper '__get__' of getset_descriptor object at 0x0000023A7ACE88B8> returned a result with an error set
[9240] Failed to execute script pyi_rth_pkgres

The package should consist of one .py file, one .uic QT file and a SQLite3 .db .

I have tried packaging with Pyinstaller in several ways, however the same exception arises when trying to execute the application.

I'm using Python 3.7.2, Pyinstaller 3.4, PySide 5.12.1 and peewee 3.9.2 .

Any help is greatly appreciated.

  • Have you used a sqlite3 db file before when freezing an app? Are you using a `spec` file? Can you post it? I'm hardly an expert, but I have frozen a couple of small apps with a sqlite3 db file with no problems on windows with almost identical module versions. – Daniel F. Mar 16 '19 at 19:53
  • 1
    Hey Daniel, thanks for your comment. I ended downgrading Pyside2 to 5.12.0 and now it packages correctly. Apparently there is an unsolved issue with Pyside2 5.12.1. – Alexander Lopez Mar 18 '19 at 22:19

1 Answers1

0

The following worked for me:
1. uninstalled pyinstaller and installed the developer version from git (but didn't change anything so far - maybe that's not necessary)
2. typed pyinstaller -v example.pyw
3. used the returned value from 2 as hidden import. In my case pyinstaller --hidden-import=4.0.dev0+869062597f example.pyw

gosuto
  • 5,422
  • 6
  • 36
  • 57