问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/65315077/interpreter-crashes-trying-to-use-tkinter-library