python - 需要 MacOS 11 或更高版本! PyCharm 上的错误

标签 python macos

我正在通过观看一些在线视频来学习如何使用 python。当我使用 PyCharm 运行下面的代码时,我得到以下信息:
需要 macOS 11 或更高版本!
进程以退出代码 134 结束(被信号 6 中断:SIGABRT)
我有一台装有 macOS Big Sur 11.1 的 M1 Mac mini。这是在我使用 Python 3.8.2 时发生的。然后,我安装了 Python 3.9.1。我不断收到同样的错误。我怎样才能解决这个问题?

import turtle

bob = turtle.Turtle()

print(bob)

最佳答案

我试着做一个简单的brew update && brew upgrade ,但这并没有多大帮助。
在进行我的研究时,Apple 似乎提供了导致该问题的旧版本 tcl-tk (8.5.xx)。
只需使用 brew 安装更新的 tcl-tk 即可解决问题:

brew install tcl-tk
这应该安装 tcl-tk 8.6.xx(在撰写本文时为 8.6.11)。
最简单的验证是:
% python3
Python 3.9.1 (default, Jan  8 2021, 17:17:43)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter as t
>>> t._test()
应该会出现一个测试小 GUI 窗口。

关于python - 需要 MacOS 11 或更高版本! PyCharm 上的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65452383/

相关文章:

macos - 为什么 WebGL 和 Cocoa 之间的 GL_ALIASED_POINT_SIZE 不同?

macos - graphviz 有没有好的 IDE 或 WYSIWYG 编辑器?

python - 是否有任何交叉引用 Python 源代码的 git web 网关

python - 如何有效地将 Java 代码转换为 python?

python - OpenStack Python Nova API 获取特定限制值?

linux - 在 Mac OS X 中清理信号量

ios - 无法在 Alert() 上单击“确定”

c++ - 当主窗口被隐藏时,pthread wait() 花费的时间比预期的要长

python - 如何注销 Django 中的用户?

python - 在迭代过程中修改数据帧不一致的行为