gpt4 book ai didi

python - 为什么 tkinter 在 Mac 上失败

转载 作者:太空宇宙 更新时间:2023-11-03 11:36:53 38 4
gpt4 key购买 nike

我在 Mac 上使用 tkinter。但是当我使用下面的简单代码时,电脑会重启。

import tkinter as tk
window = tk.Tk()

问题是什么?谢谢!

  • Mac:Mojave,版本 10.14.6
  • tkinter:版本 8.6
  • python :3.7.3

最佳答案

好像是常见问题python.org/download/mac/tcltk/#built-in-8-6-8据他们说

If you are using macOS 10.6 or later, the Apple-supplied Tcl/Tk 8.5 has serious bugs that can cause application crashes.

与其修复 TCL/TK,我建议您重新安装满足要求的 python 版本并使用它 python.org/downloads/release/python-374

关于python - 为什么 tkinter 在 Mac 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57505107/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com