目前使用最新的 版本(3.7.0)就可以了
解决大全
说白了还是不兼容不匹配 的问题
这里解决的办法是 使用的 ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded 的版本,最新的8.6.6_1不行!
在 IDLE 下中文输入法失效,无法显示出中文输入法的选词框。在这种情况下打开 IDLE 时会显示一段警告:
这是因为 IDLE 界面使用的 Tkinter 图形库需要依赖 Tcl/Tk,而 Mac 系统自带的 Tcl/Tk 版本太低,造成了不兼容的问题。
(IDLE and tkinter with Tcl/Tk on Mac OS X)
解决方法是下载安装新版本的 Tcl/Tk,下载地址:https://www.activestate.com/activetcl/downloads
以下没成功!!!
而如果有使用 Homebrew 的话,可以用 brew install tcl-tk 安装新版本的 Tcl/Tk(如果有用 Homebrew 来安装 Python,可以在安装时加上 --with-tcl-tk 选项来同时安装 Tcl/Tk:brew install python --with-tcl-tk)。
mac$ brew install tcl-tk
Updating Homebrew...
==> Using the sandbox
==> Downloading https://downloads.sourceforge.net/project/tcl/Tcl/8.6.6/tcl8.6.6-
==> Downloading from https://nchc.dl.sourceforge.net/project/tcl/Tcl/8.6.6/tcl8.6
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/tcl-tk/8.6.6_1 --mandir=/usr/local/Cel
==> make
==> make install
==> make install-private-headers
==> Downloading https://downloads.sourceforge.net/project/tcl/Tcl/8.6.6/tk8.6.6-s
==> Downloading from https://nchc.dl.sourceforge.net/project/tcl/Tcl/8.6.6/tk8.6.
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/tcl-tk/8.6.6_1 --mandir=/usr/local/Cel
==> make TK_LIBRARY=/usr/local/Cellar/tcl-tk/8.6.6_1/lib
==> make install
==> make install-private-headers
==> Downloading https://downloads.sourceforge.net/project/tcllib/tcllib/1.18/tcll
==> Downloading from https://nchc.dl.sourceforge.net/project/tcllib/tcllib/1.18/t
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/tcl-tk/8.6.6_1 --mandir=/usr/local/Cel
==> make install
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because tk installs some X11 headers and macOS provides an (older) Tcl/Tk.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/tcl-tk/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/tcl-tk/lib
CPPFLAGS: -I/usr/local/opt/tcl-tk/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/tcl-tk/lib/pkgconfig
==> Summary
🍺 /usr/local/Cellar/tcl-tk/8.6.6_1: 2,847 files, 29MB, built in 4 minutes 33 seconds
输出以上信息,说明安装成功,安装目录在(/usr/local/Cellar/tcl-tk/8.6.6_1)
配置Tcl/Tk环境变量,指向新安装的Tcl/Tk