easygui buttonbox crashes becase of default font from Tkinter

Question:

I’m using easygui in a Python app and then generate an .exe with PyInstaller.

Everything works fine in my computer, but my colleague get this weird error when they try to run the app :

Traceback (most recent call last):
File "easyguiboxesbutton_box.py", line 95, in buttonbox
File "easyguiboxesbutton_box.py", line 147, in __init__
File "easyguiboxesbutton_box.py", line 268, in __init__
File "tkinterfont.py", line 23, in nametofont
File "tkinterfont.py", line 86, in __init__
RuntimeError: main thread is not in main loop

The line where easygui is called is simply

choice = easygui.buttonbox(
"msg", "title", choices=["choice1", "choice2"],
default_choice="choice1", cancel_choice="choice2"
)

so the problem seems to be with the font but I’m not using anything particular in easygui ? I’ve searched for issues on the easygui’s Git but couldn’t find anything

Also, there was another easygui.buttonbox earlier in the process but this one did show up properly so I’m just really confused.

Thanks!

Asked By: gee3107

||

Answers:

The solution was to show the msgbox in the main thread. It crashed because the msgbx was in a different thread than the main one

Answered By: gee3107