Python 3.4.1 installer on Mac links Python to old Tcl/Tk
Ned Deily
nad at acm.org
Tue Jun 24 17:07:09 EDT 2014
In article <locf10$td8$1 at ger.gmane.org>,
"Peter Tomcsanyi" <tomcsanyi at slovanet.sk> wrote:
> I use the Python 3.4.1 installer from
> https://www.python.org/downloads/release/python-341/
>
> The Windows installation comes with Tcl/Tk version 8.6 which has some new
> features (compared to 8.5) that are very important to me.
>
> But the Mac installer does not include Tcl/Tk and the page:
> https://www.python.org/download/mac/tcltk
> says:
> "The Python 64-bit/32-bit Mac OS X installers for Python 3.4.x, 3.3.x,
> 3.2.x, and 2.7.x dynamically link to Tcl/Tk 8.5 frameworks."
>
> I tried to download and install ActiveTcl 8.6.1 for Mac, but Python does not
> use it...
>
> Can anyone help me make Python 3.4.1 use Tcl/Tk 8.6 on Mac OS X (10.9.2, if
> that matters)?
>
> Does anyone know why the Windows installer brings the newest version of
> Tcl/Tk while the Mac installer remains with the previous version? When this
> is planned to be changed?
The main reason is that we have tried to follow what Apple does with OS
X. Unlike Windows, OS X is shipped with Apple-supplied versions of
Tcl/Tk. For OS X 10.6, Apple helped support the development of a new
native variant of Tk for OS X (the Cocoa Tk) that supports 64-bit mode.
The previous OS X native mode Tk (Carbon) only works in 32-bit
processes. At the time of the release of 10.6, Tk 8.6 was not yet
released. For whatever reasons, Apple has continued to ship only 8.5
and 8.4 in releases through current 10.9.x. Unfortunately, it has
turned out that Cocoa Tk has had a number of very serious bugs. Many of
them have been fixed in newer releases of 8.5.x and the now-released
8.6.x but remain unfixed in the older versions of 8.5.x shipped by
Apple. Also, up until relatively recent releases, there were issues
with Python's Tkinter when built and linked with Tk 8.6.x. We think
most of those issues should have been fixed in the current releases
(like 3.4.1). But, because of the messy situation with Tk support on OS
X, there really hasn't been an incentive for us to move to 8.6.x for the
python.org OS X installers; it's been challenging enough to get 8.5.x
stable. Another issue is that there are binary installers for some
popular third-party packages for Python on OS X that depend on the
python.org installers and also depend on Tk (like matplotlib) so any
change in Tk version would affect them as well. At some point, I would
like to move to 8.6.x or at least make it an option but we don't have a
schedule for it yet.
It's a bit messy to try to build Python with Tk 8.6 yourself from source
but it can be done if you don't mind not using the python.org version.
To do so, make sure you have ActiveTcl 8.6 installed and that it is the
"Current" version in the /Library/Frameworks for Tcl and Tk. Then
configure Python for a framework build (--enable-framework).
Probably easier, though, is to install Python 3.4 from MacPorts which
does provide its own version of Tcl/Tk 8.6.1, the Cocoa version by
default or optionally an X11 version:
# after installing the base MacPorts
sudo port selfupdate
sudo port install py34-tkinter +quartz
/opt/local/bin/python3.4
The easiest option would be a downloadable package that would allow the
default python.org 8.5-linked _tkinter to be overridden with an 8.6
version. There may be some news on that front in the near future.
--
Ned Deily,
nad at acm.org
More information about the Python-list
mailing list