After a day of headache, this worked for me:
$ brew install python-tk
Answer from subtleseeker on Stack OverflowAfter a day of headache, this worked for me:
$ brew install python-tk
I've had the same issue:
ModuleNotFoundError: No module named 'tkinter'
After quite a while I finally realized that I needed to install the python-tk package. On Linux all I needed to do was sudo apt-get install python3-tk.
python - How to pip install tkinter - Stack Overflow
python - How to install tkinter on M1 Mac - Stack Overflow
How do I run the version of tkinter I brew installed instead of the system version?
Tkinter issue on macOS :(
Videos
Tkinter isn't distributed through pip; if it didn't come pre-packaged with Python, you have to get it from elsewhere:
- Ubuntu
sudo apt-get install python3-tk
- Fedora
sudo dnf install python3-tkinter
- MacOS
brew install python-tk
For Windows, check this checkbox during setup.

On MacOS 12.5 I have updated to the latest version of Python and pip and I just brew installed tkinter. When I do "python3 -m tkinter", I get the message: DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. - and the window that launches is buggy.
It seems like the command above is not running the version of tkinter I just installed with brew.
Why is that and how do I get rid of this deprecated system version?
Or in general what is the real issue here?
Thanks very much
» pip install tkmacosx