With Python Interpreter it works fine, image loads and main.py runs without problems, but when I make it into one file .exe with Pyinstaller, .exe crashes with the following error message.
FileNotFoundError: 'themes.json' resource not found in 'ttkboostrap'
Any help would be sincerely appreciated.
Had the same issue.
Head over to where your
ttkbootstrapis installed, copythemes.jsonandSymbola.ttf(if required) to the same folder as yourmain.pyandmain.spec.Then modify your
main.specwithdatas=[('themes.json', 'ttkbootstrap'), ('Symbola.ttf', 'ttkbootstrap')]undera = Analysis().Symbola.ttfmay not be required for you but I encountered another FileNotFoundError after copyingthemes.jsonover to the folder, which required me to bring overSymbola.ttfas well.Once done, run
pyinstaller main.specon elevated command prompt.