Cannot get python to use Tcl/Tk version 8.6


(davbeek) #1

When I install python using

brew install python --with-tcl-tk

I get:

Warning: python: this formula has no --with-tcl-tk option so it will be ignored!

However, then the version of Tcl/Tk that is used is 8.5 (old native version from Mac).
The tcl/tk version from home-brew is: /usr/local/Cellar/tcl-tk/8.6.8
I have updated the Tcl/Tk version on my Mac (see tkdocs.com), so that in bash, I get:
~$ wish
% info patchlevel
8.6.8

However, still python3 uses the old Tcl/TK version:

import tkinter
tkinter.TkVersion
8.5

Unstalling and reinstalling python in homebrew does not help.

When I install python from python.org, python does use the (builtin) Tcl/Tk 8.6 version.


(Sean Molenaar) #2

That’s correct. The reasoning can be found here: https://github.com/Homebrew/homebrew-core/pull/34424 and in the issue it links to.


(davbeek) #3

Thanks for your answer. I understand the reason for removing the --with-tcl-tk option.

What is currently the alternative of getting Python to link the Tcl/Tk 8.6 version in Homebrew?


(Sean Molenaar) #4

There isn’t an official way to do this but you could maintain your own tap with this option enabled. https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap might be helpfull in this.