Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Macos python 3.9 idle IDLE can't import Tkinter [duplicate]

Tags:

python

macos

On my Mac, I install python 3.9 via homebrew. I try to launch idle and get this error:

> idle3

** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **

MacOS: 11.4 Homebrew: 3.1.9-121-g654c78c Python: 3.9.5

like image 940
user3153765 Avatar asked Oct 21 '25 00:10

user3153765


1 Answers

This is a Mac-only error, and as per @user3153765 's comment, running

brew install python-tk

will work as long as you have home-brew installed on your machine. If you do not have home-brew, check it out here! It is in my required reading list for all Mac-OS users.

If you decide, for some good reason that I have not thought of, not to use homebrew, you can also fix this with

sudo apt-get install python3-tk

if you have chosen to go the Ubuntu-based package manager route

like image 197
Shep Sims Avatar answered Oct 23 '25 14:10

Shep Sims



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!