8

I have tried to staring the application in VSCODE by Python3.
This is the code:

from tkinter import *

window = Tk()
window.mainloop()

only 3 lines :)), but when I'm trying to execute the file in terminal it will give me an error, which you can see below.

arash@Arash-MacBook-Pro tkinter % python3 main.py 
macOS 11 or later required !
zsh: abort ------ python3 main.py
arash@Arash-MacBook-Pro tkinter %

My Mac worked on "Big Sur" and has Python3.9.

Arash Khosravi
  • 103
  • 1
  • 7

2 Answers2

12

This is an issue in the way brew installs Python (source). If you install Python directly via the official installer here then tkinter should work as expected.

asherbret
  • 5,439
  • 4
  • 38
  • 58
0

If you installed python using brew you can also use the following command to install the missing package:

brew install python-tk@3.9
hopeman
  • 2,778
  • 3
  • 18
  • 33