Pyinstaller błąd "Unhandled exeption in script"

0

Napisałem aplikację w Pythonie i za pomocą Pyinstallera chciałem stworzyć plik .exe. Jednak coś nie działa i nie jestem w stanie sobie z tym poradzić. Na zdjęciu poniżej przesyłam błąd jaki mi wyskakuje gdy próbuję odpalić aplikację za pomocą stworzonego pliku.exe. Czy ma ktoś jakiś pomysł co może być nie tak?
screenshot-20230824231043.png

Traceback (most recent call last):
  File "customtkinter\windows\widgets\theme\__init__.py", line 5, in <module>
  File "customtkinter\windows\widgets\theme\theme_manager.py", line 20, in load_theme
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\48537\\Desktop\\Python\\Forklift capacity\\dist\\main\\customtkinter\\assets\\themes\\blue.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 1, 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 385, in exec_module
  File "customtkinter\__init__.py", line 10, 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 385, in exec_module
  File "customtkinter\windows\__init__.py", line 1, 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 385, in exec_module
  File "customtkinter\windows\ctk_tk.py", line 9, 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 385, in exec_module
  File "customtkinter\windows\widgets\__init__.py", line 1, 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 385, in exec_module
  File "customtkinter\windows\widgets\ctk_button.py", line 6, 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 385, in exec_module
  File "customtkinter\windows\widgets\theme\__init__.py", line 7, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\48537\\Desktop\\Python\\Forklift capacity\\dist\\main\\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
7

Jest wyrażnie napisane FileNotFoundError, co oznacza, że plik znaleziono i nie ma błędu.

Teraz żeby był błąd musisz wejść na tą stronę:
https://customtkinter.tomschimansky.com/documentation/packaging

I tam masz napisane, że nie wolno pakować do jednego exeka wszystkiego, a trzeba cały folder dać z plikami, bo taka jest wola autora biblioteki.

0

Dzięki wielkie. Faktycznie prosta sprawa była.

1 użytkowników online, w tym zalogowanych: 0, gości: 1