[英]Updating tcl/tk version of Homebrew python3 on macOS
My environment:我的环境:
macOS 10.13 python 3.7.1 from Homebrew来自 Homebrew 的 macOS 10.13 python 3.7.1
I'm having lots of Tcl/TK quirks on the stock Tcl/TK 8.5 under /System/Library/Frameworks/Tcl.framework/Versions/8.5/
, and would like to upgrade my Tcl/TK.我在
/System/Library/Frameworks/Tcl.framework/Versions/8.5/
下的库存 Tcl/TK 8.5 上有很多 Tcl/TK 怪癖,并且想升级我的 Tcl/TK。
But with this question I couldn't find any working tips for upgrading, including:但是有了这个问题,我找不到任何升级的工作提示,包括:
https://discussions.apple.com/thread/8066794 https://discussions.apple.com/thread/8066794
IDLE warns against an old TCL version even though I've installed a newer version 即使我安装了较新的版本,IDLE 也会对旧的 TCL 版本发出警告
Why my Python installed via home brew not include Tkinter 为什么我通过 Home brew 安装的 Python 不包括 Tkinter
How to change the tk version of your Python installation? 如何更改 Python 安装的 tk 版本?
How do I link the ActiveState distribution of Tcl/Tk to HomeBrew installed Python 如何将 Tcl/Tk 的 ActiveState 分发版链接到 HomeBrew 安装的 Python
My test results我的测试结果
--with-tcl-tk
no longer works with the latest Homebrew. --with-tcl-tk
不再适用于最新的 Homebrew。 Running brew install python --with-tcl-tk
still points to system Tcl/TK 8.5.9.brew install python --with-tcl-tk
仍然指向系统 Tcl/TK 8.5.9。After many more failures, I concluded that the easiest way to make this work is to completely forget about Homebrew, uninstall its python packages.在多次失败之后,我得出结论,使这项工作最简单的方法是完全忘记 Homebrew,卸载其 python 包。
Then install the latest ActiveTcl and then the python.org version instead.然后安装最新的 ActiveTcl,然后安装 python.org 版本。 The python.org version will work on top of the latest "System" Tcl/TK, which will be refreshed after installing the ActiveTcl.
python.org 版本将在最新的“系统”Tcl/TK 之上工作,安装 ActiveTcl 后将刷新。 Unfortunately, Homebrew ignores it.
不幸的是,Homebrew 忽略了它。
The current 3.7.2 from python.org is compiled with Tcl/TK 8.6.8:来自 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
After updating it, several bugs like checkbuttons showing wrong checkmarks on a menu disappeared.更新后,一些错误,例如在菜单上显示错误复选标记的复选按钮消失了。
This post provides a neat way:这篇文章提供了一种简洁的方法:
https://stackoverflow.com/a/60469203/10606936 https://stackoverflow.com/a/60469203/10606936
NOT NEEDED to use actviveTk or python.org python installation.不需要使用 activetk 或 python.org python 安装。
Keypoint is provide the correct ENV for installtion. Keypoint 是为安装提供正确的 ENV。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.