Pyinstaller error with tkinter's multiple windows

520 views
Skip to first unread message

Christos Fyt

unread,
Mar 14, 2021, 9:31:14 AM3/14/21
to PyInstaller
Hello

I face a problem when trying to convert my .py file to .exe.

My .py file uses GUI interface and multiple windows open when clicking some buttons. To be specific I have one main window and 2 more that have been added to code as new_window = Toplevel(window)

The problem is that when .py is converted to exe the main window is displayed and working fine but those additional windows are not loaded and not working properly.

I have to say that my program runs smoothly in pycharm so there is no error in the code.

I couldn't find anything relevant in my google search.13-3-2021 11-28-01 πμ.jpg

Thank you.

Christos Fyt

unread,
Mar 14, 2021, 12:01:19 PM3/14/21
to PyInstaller
Solved. I will apply the solution here if anyone is interested.

During the conversion enter --console for the console to appear when you run the exe file. (pyinstaller --console filename.py)

When you run the exe and face an error like me, the error will appear on the console screen.

For me it was the missing icon files of the new windows that I forgot to add in the final file that contains exe and all the additional files (photos, databases etc).

That's it, it worked!

Reply all
Reply to author
Forward
0 new messages