我的环境:
macOS 10.13 来自 Homebrew 的 python 3.7.1
我在 /System/Library/Frameworks/Tcl.framework/Versions/8.5/
下的库存 Tcl/TK 8.5 上有很多 Tcl/TK 怪癖,我想升级我的Tcl/TK.
但是带着这个问题我找不到任何升级的工作技巧,包括:
IDLE warns against an old TCL version even though I've installed a newer version
How do I link the ActiveState distribution of Tcl/Tk to HomeBrew installed Python
我的测试结果
--with-tcl-tk
不再适用于最新的 Homebrew。运行brew install python --with-tcl-tk
仍然指向系统 Tcl/TK 8.5.9。- 以上内容还通过卸载/安装循环进行了测试。
- Python 在安装最新的 ActiveTcl 后继续使用系统 Tcl/TK。
最佳答案
在多次失败之后,我得出结论,使这项工作最简单的方法是完全忘记 Homebrew,卸载它的 python 包。
然后安装最新的 ActiveTcl,然后安装 python.org 版本。 python.org 版本将在最新的“系统”Tcl/TK 之上运行,它将在安装 ActiveTcl 后刷新。不幸的是,Homebrew 忽略了它。
当前来自 python.org 的 3.7.2 是使用 Tcl/TK 8.6.8 编译的:
$ python3
Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter as tk
>>> print(tk.Tcl().eval('info patchlevel'))
8.6.8
更新后,一些错误(如复选按钮在菜单上显示错误的复选标记)消失了。
关于python - 在 macOS 上更新 Homebrew python3 的 tcl/tk 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53930597/