【发布时间】:2021-04-21 15:28:16
【问题描述】:
我试图编写一些 python 代码,在我的代码中我导入了 turtle 模块,当我在 VSCode 上运行我的代码时,我希望看到一个 GUI 窗口,但我得到了以下错误:
除此之外,我还收到了一份 Python 问题报告:
这是我的代码的样子:
import turtle
my_turtle = turtle.Turtle()
my_turtle.shape("turtle")
my_turtle.color("red")
my_turtle.forward(100)
screen = turtle.Screen()
screen.exitonclick()
我的 macOS 版本是 11.1 btw。
【问题讨论】:
-
直接在终端运行是否有效?
-
问题报告引用了 Python 2.7.16,该版本已过时且不再受支持。
-
“需要 macOS 11 或更高版本”出现在我的终端上
-
如果它引用 Python 2.7.16 那么将 Python 更新到最新版本会有帮助吗?
标签: python macos visual-studio-code turtle-graphics