Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link the ActiveState distribution of Tcl/Tk to HomeBrew installed Python

Tags:

I am using macOS 10.12.1 Sierra. I am using Python 2.7.12 installed with

brew install python 

but the IDLE gives the warning

WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. 

and sure enough, it crashed frequently. 8.5.9 is the macOS preinstalled version.

I can download the stable 8.5.18 from the ActiveState website (as recommend by python, which works with the python installations from python.org (as they look for any other version of Tcl/Tk before resorting to the unstable macOS default 8.5.9).

However this download does not affect the brew installed python IDLE, which continues to use 8.5.9.

Is there anything I can do to link the updated Tcl/Tk with Homebrew, or can I install Tcl/Tk direct with homebrew?

I have also noticed that exactly the same problem happens when using anaconda python, which uses the preinstalled mac tcl/tk 8.5.9, not the user-installed tcl/tk 8.5.18

like image 684
Tom Burrows Avatar asked Nov 18 '16 17:11

Tom Burrows


1 Answers

tcl-tk can be installed via Homebrew and one can have the Homebrew installed python linked to that version (Homebrew installed) of tcl-tk.
The only "barrier" to that, is to enable the right homebrew tap, as tcl-tk is not found in the "default" taps in Homebrew.
Indeed tcl-tk is found in the tap called homebrew-dupes which contain (cite the page)

formulae that duplicate software provided by macOS, though may provide more recent or bugfix versions.

Here the link to homebrew-dupes:
https://github.com/Homebrew/homebrew-dupes
and here the formula for tcl-tk
https://github.com/Homebrew/homebrew-dupes/blob/master/tcl-tk.rb

So the complete recipe to solve the problem would be:

  1. Activate/Install the homebrew-dupes tap
  2. Install tcl-tk
  3. Install homebrew python using homebrew tcl-tk

The commands to be executed follow:

  1. brew tap homebrew/dupes
  2. brew install tcl-tk
  3. brew install python --with-tcl-tk
like image 162
fedepad Avatar answered May 26 '23 07:05

fedepad