Pyinstaller throwing error about ctk but not tk

Viewed 12

I've created a GUI with CTk (Github) and a other one with basic Tk (Tk Python Docs). I tried to convert both to .exe with pyinstaller, but the CTk one didn't work, it only threw this error quickly and exit:

gui.exe
Traceback (most recent call last):
  File "customtkinter\__init__.py", line 20, in <module>
  File "customtkinter\theme_manager.py", line 16, in load_theme
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Heikki\\AppData\\Local\\Temp\\_MEI117522\\customtkinter\\assets\\themes\\blue.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "GUI.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "customtkinter\__init__.py", line 22, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Heikki\\AppData\\Local\\Temp\\_MEI117522\\customtkinter\\assets\\themes\\blue.json'

The .json theme file for CustomTkinter could not be found.
If packaging with pyinstaller was used, have a look at the wiki:
https://github.com/TomSchimansky/CustomTkinter/wiki/Packaging#windows-pyinstaller-auto-py-to-exe
[9004] Failed to execute script 'GUI' due to unhandled exception!

I kind of see the problem here (by reading the error message), but Im not familiar with GUIs, what should I do?

Pyinstaller command:

pyinstaller --onefile GUI.py
0 Answers
Related