目前使用最新的 版本(3.7.0)就可以了
解決大全
說(shuō)白了還是不兼容不匹配 的問(wèn)題
這里解決的辦法是 使用的 ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded 的版本,最新的8.6.6_1不行!
在 IDLE 下中文輸入法失效,無(wú)法顯示出中文輸入法的選詞框。在這種情況下打開(kāi) IDLE 時(shí)會(huì)顯示一段警告:
這是因?yàn)?IDLE 界面使用的 Tkinter 圖形庫(kù)需要依賴 Tcl/Tk,而 Mac 系統(tǒng)自帶的 Tcl/Tk 版本太低,造成了不兼容的問(wèn)題。
(IDLE and tkinter with Tcl/Tk on Mac OS X)
解決方法是下載安裝新版本的 Tcl/Tk,下載地址:https://www.activestate.com/activetcl/downloads
以下沒(méi)成功!!!
而如果有使用 Homebrew 的話,可以用 brew install tcl-tk 安裝新版本的 Tcl/Tk(如果有用 Homebrew 來(lái)安裝 Python,可以在安裝時(shí)加上 --with-tcl-tk 選項(xiàng)來(lái)同時(shí)安裝 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
輸出以上信息,說(shuō)明安裝成功,安裝目錄在(/usr/local/Cellar/tcl-tk/8.6.6_1)
配置Tcl/Tk環(huán)境變量,指向新安裝的Tcl/Tk