Interpreter crashes trying to use tkinter library

吃可爱长大的小学妹 提交于 2021-01-26 10:31:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!