For Python3 tkinter can be simply installed by,
brew install python-tk
pip sometimes wont work successfully on my Mac, especially with the High Sierra OS version. Brew can be used to install all kinds of software packages in mac.
Answer from Coder94 on Stack OverflowFor Python3 tkinter can be simply installed by,
brew install python-tk
pip sometimes wont work successfully on my Mac, especially with the High Sierra OS version. Brew can be used to install all kinds of software packages in mac.
I was having the same issue with the module name change in Python2 to Python3.. as stated in the previous post, "brew install python-tk" worked for me. I'm running the following:
- Python 3.9.13 64-bit
- vsCode 1.68.0
- macOS Monterey
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.
Python application doesn't find tkinter but it's installed
tkinter not working on pyenv install on macOS
Bug: "ModuleNotFoundError: No module named '_tkinter" when importing PySimpleGUI
Tkinter does not work (MacOS)
Videos
I am new to Tkinter and gui coding and facing an error with it on my Mac in Visual Studio Code. When I am trying to run my code, the window does not show anything (for example the colour).
from tkinter import *
root = Tk() #
root.title("Tk Example")
root.configure(background="yellow")
root.minsize(200, 200)
root.maxsize(500, 500)
root.geometry("300x300+50+50")
root.mainloop()
Thanks for any Help
After 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.