所以我过去几个月一直在使用Pyinstaller作为单个EXE文件包装和分发我的应用程序,但是我最近从GUI应用程序中使用TKINTER进行了切换到使用Pyside2(QT5包装器)。问题是,我无法打包这些可执行文件,因为我在运行时遇到以下错误:
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 "PyInstallerloaderrthookspyi_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:UsersfelipAppDataRoamingPythonPython37site-packagesPyInstallerloaderpyimod03_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:UsersfelipAppDataRoamingPythonPython37site-packagesPyInstallerloaderpyimod03_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:UsersfelipAppDataRoamingPythonPython37site-packagesPyInstallerloaderpyimod03_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:UsersfelipAppDataRoamingPythonPython37site-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "signal.py", line 45, in <module>
File "c:program filespython37libfunctools.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
该软件包应由一个.py文件,一个.UIC QT文件和一个SQLITE3 .db。
我尝试使用多种方式与Pyinstaller打包,但是在尝试执行应用程序时出现了同样的例外。
我正在使用Python 3.7.2,Pyinstaller 3.4,Pyside 5.12.1和Peewee 3.9.2。
任何帮助都非常感谢。
以下对我有用:
1.卸载的pyinstaller,并从git安装了开发人员版本(但没有更改任何内容 - 也许不是必需的)
2.键入pyinstaller -v example.pyw
3.将返回的值从2用作隐藏导入。在我的情况下, pyinstaller --hidden-import=4.0.dev0+869062597f example.pyw