Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When running python 3.9.4 I am unable to import tkinter, but downgrading to 3.8.2 works perfectly fine

Im on macOS Catalina running tcl 8.6.11, I installed python3 using brew install python3

tclsh
% info patchlevel
8.6.11

Current version of python 3.9.4

python3 --version 
Python 3.9.4 

>>> import tkinter 
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

Downgrading to 3.8.2

python3 --version 
Python 3.8.2

>>> import tkinter
>>> 

Not sure what is causing this, any insight would be appreciated

like image 315
Aditya Garg Avatar asked May 02 '21 15:05

Aditya Garg


1 Answers

Looks like tkinter is disabled in brew for python 3.9 but not for 3.8,
it's commented on their github.

Try the python-tk formula if you want to use python 3.9.

like image 62
Zazzed Coffee Avatar answered Nov 15 '22 08:11

Zazzed Coffee