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.
Python3 installation with tkinter
python - How to pip install tkinter - Stack Overflow
Tkinter issue on macOS :(
python - How to install tkinter on M1 Mac - Stack Overflow
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.

Hello everyone,
I'm trying to tackle school coursework requiring me to use the Tkinter library. Initially, anything I would attempt to display would result in a black screen. After consulting with ChatGPT, and reinstalling python and tcl-tk via homebrew I now receive this error :
~ % python3 -m tkinter
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'
These are the versions of python I'm using :
~ % which python3
/opt/homebrew/bin/python3
~ % python3 --version
Python 3.13.0
brew install tcl-tk
Warning: tcl-tk 9.0.0_1 is already installed and up-to-date.
MAC OS : 15.0.1 (24A348)
If anyone has any suggestions on how I could solve this error please let me know.