Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ellieot opened this issue Aug 13, 2022 · 2 comments
Closed

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

ellieot opened this issue Aug 13, 2022 · 2 comments

Comments

@ellieot
Copy link

ellieot commented Aug 13, 2022

[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

@GT-ZhangAcer
Copy link
Member

GT-ZhangAcer commented Aug 13, 2022 via email

@ellieot
Copy link
Author

ellieot commented Aug 13, 2022

查阅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

@ellieot ellieot closed this as completed Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants