在 macOS 上更新 Homebrew python3 的 tcl/tk 版本 [英] Updating tcl/tk version of Homebrew python3 on macOS

查看:65
本文介绍了在 macOS 上更新 Homebrew python3 的 tcl/tk 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的环境:

macOS 10.13来自 Homebrew 的 python 3.7.1

macOS 10.13 python 3.7.1 from Homebrew

我在 /System/Library/Frameworks/Tcl.framework/Versions/8.5/ 下的库存 Tcl/TK 8.5 上有很多 Tcl/TK 怪癖,并且想升级我的Tcl/TK.

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.

但是对于这个问题,我找不到任何升级的工作提示,包括:

But with this question I couldn't find any working tips for upgrading, including:

即使我安装了较新的版本,IDLE 也会针对旧的 TCL 版本发出警告

为什么我的 Python 是通过 home 安装的brew 不包括 Tkinter

如何更改 tk 版本您的 Python 安装?

如何将 Tcl/Tk 的 ActiveState 分发版链接到 HomeBrew 安装的 Python

我的测试结果

  1. --with-tcl-tk 不再适用于最新的 Homebrew.运行 brew install python --with-tcl-tk 仍然指向系统 Tcl/TK 8.5.9.
  2. 上述内容还通过卸载/安装周期进行了测试.
  3. Python 在安装最新的 ActiveTcl 后继续使用系统 Tcl/TK.
  1. --with-tcl-tk no longer works with the latest Homebrew. Running brew install python --with-tcl-tk still points to system Tcl/TK 8.5.9.
  2. The above is also tested with an uninstall/install cycle.
  3. Python keeps using system Tcl/TK after installing latest ActiveTcl.

推荐答案

在多次失败后,我得出的结论是,使这项工作顺利进行的最简单方法是完全忘记 Homebrew,卸载其 Python 包.

After many more failures, I concluded that the easiest way to make this work is to completely forget about Homebrew, uninstall its python packages.

然后安装最新的 ActiveTcl,然后安装 python.org 版本.python.org 版本将在最新的系统"Tcl/TK 之上工作,安装 ActiveTcl 后将刷新.不幸的是,Homebrew 忽略了它.

Then install the latest ActiveTcl and then the python.org version instead. The python.org version will work on top of the latest "System" Tcl/TK, which will be refreshed after installing the ActiveTcl. Unfortunately, Homebrew ignores it.

来自 python.org 的当前 3.7.2 是用 Tcl/TK 8.6.8 编译的:

The current 3.7.2 from python.org is compiled with 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.

这篇关于在 macOS 上更新 Homebrew python3 的 tcl/tk 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆