I am building a py file into exe using PyInstaller. Whenever I try to open the .exe, I get the error:
Traceback (most recent call last):
File "main_gui.py", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter'
I tried every solution I could find online:
- Tried using the –hidden-import flag with tkinter and rebuilding
- Tried adding tkinter to the hidden imports in the .spec file
- Tried removing the excludeimport tkinter from the hooks in the Lib/site-packages/PyInstaller/hooks
Nothing I have tried works. Still getting the same error