Open mihaaairu opened 1 year ago
Looks like I figured out the main problem. I've used CTk text widget with 'font' option, which calls font package. And pyinstaller can't attach this package (font files) to the .exe, IMHO. I'm not sure about real reason which cause crash. So, it need to be tested.
I am also having this issue, no matter how many ways I include the customtkinter files, even on minimal programs (ie: importing customtkinter and showing a single label). The program works fine running directly with python, but when it is packaged up I get the same error. Seems to only be an issue with windows, as I am not having the issue on WSL Debian
In my opinion, you should try auto-py-to-exe. It's better than pyinstaller because of better gui and functionality. You might have forgotten to add some binaries or something else. I also use customtkinter framework with auto-py-to-exe and trust me, there is nothing better than that thing. here is instruction of how to use it: https://customtkinter.tomschimansky.com/documentation/packaging
Having the same issue.
From what I can tell, the actual problem is not that CTK fails to load the fonts, but that CTK tries to write to the console explaining the failure. Because .pyw files have no console to write to, it crashes. If CTK's font management functions didn't have those write() commands, my EXE would run.
In the meantime, I've just created the EXE from a .py file so there's a console to push the error to.
To avoid json crashes and compile the program into one file, i putted necessary json into the .py file. And all worked nice, except font issue, which appeared unpredictable. I've already made some builds with json import as .py file with dictionary, and all worked well. So, i'm not sure, that json causes that. So, now about the main issue. After
pyinstaller --one-file main.pyw
, created .exe file raises this error:I don't understand the problem, as long as i didn't use any custom_tkinter fonts and imported CTkTextbox only.