3

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

user3153765
  • 333
  • 3
  • 14

2 Answers2

3

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

Shep Sims
  • 302
  • 4
  • 15
-1
sudo port install py39-tkinter
Sven Eberth
  • 2,943
  • 12
  • 21
  • 27
Ngoc Nguyen
  • 489
  • 3
  • 5