QPT-Family / QGUI

QGUI - 0.1MB超轻量Python GUI框架,用模板来快捷制作深度学习模型推理界面

Home Page:https://qgui.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

【bug】使用pyinstaller打包后再执行报错

ellieot opened this issue · comments

[Errno 2] No such file or directory: 'xxxxx\ttkbootstrap\themes.json'
[15164] Failed to execute script 'gui' due to unhandled exception!

Traceback (most recent call last):
File "gui.py", line 484, in
File "qgui\factory.py", line 50, in init
File "ttkbootstrap_init_.py", line 80, in init
File "ttkbootstrap_init_.py", line 100, in _load_themes
File "importlib\resources.py", line 169, in read_text
File "importlib\resources.py", line 125, in open_text
File "PyInstaller\loader\pyimod02_importers.py", line 539, in open_resource
File "pathlib.py", line 1208, in open
File "pathlib.py", line 1063, in _opener

查阅ttkbootstrap 的Issue之后发现解决办法了,这里给后来人提醒,只需要添加参数 --collect-all 即可
pyinstaller yourprogram.py --collect-all ttkbootstrap
同理,此后会报错:
qgui is not a valid theme name. Please try one of the following:
['classic', 'minty', 'superhero', 'journal', 'flatly', 'cosmo', 'lumen', 'clam', 'cyborg', 'darkly', 'xpnative', 'yeti', 'alt', 'default', 'united', 'sandstone', 'vista', 'winnative', 'litera', 'solar', 'pulse']
Traceback (most recent call last):
File "gui.py", line 483, in
File "qgui\factory.py", line 53, in init
File "ttkbootstrap_init_.py", line 89, in colors
AttributeError: 'NoneType' object has no attribute 'colors'
[22720] Failed to execute script 'gui' due to unhandled exception!
添加参数:--collect-all qgui