[Tkinter-discuss] how make active python 3 use active tcl on mac os?

Ned Deily nad at acm.org
Wed Nov 24 02:11:23 CET 2010


In article 
<AANLkTinfC8UBv3XJ3q+UxT7OYHVQRUNhOJYavE6K-b_u at mail.gmail.com>,
 David Cortesi <davecortesi at gmail.com> wrote:
> I installed ActiveState Python 3.1.4, and also ActiveState Tcl/Tk, both on
> Mac OS X 10.6.
> 
> Python3 executing "import * from tkinter" is getting and executing the Apple
> version of Tcl/Tk which is level 8.5.7. It appears to be getting it from
> /System/Library/Frameworks/Tk.framework and Tcl.framework.
> 
> The ActiveTc (level 8.5.9) is in /Library/Frameworks rather than
> /System/Library Frameworks. It contains a bug fix that I need.
> 
> Any suggestions on how I tell python3 to find the later Tcl/Tk instead of
> the Apple one?
> 
> Also just by the way, how in program code can you check the release level of
> Tk or ttk?

I have no direct experience with how the ActiveState folks package up 
their Python installers but my guess is that the Python 3.1 is launching 
in 64-bit mode and, at the moment, the only "standard" 64-bit non-X11 Tk 
is the one Apple supplies in 10.6 /System/Library.  The A/S version 
probably attempts to use it in 64-bit mode.  If you don't really need to 
run in 64-bit, try running it in 32-bit mode which may very well link 
with the A/S Tk 8.5.  I expect that either of these should work:

arch -i386 /usr/local/bin/python3.1

or 

arch -i386 /Library/Frameworks/Python.framework/Versions/3.1/bin/python3

You can tell which Tk is being linked to for the 32- and 64-bit version 
with:

otool -L $(arch -i386 python3 -c 'import _tkinter;\
               print(_tkinter.__file__)')
otool -L $(arch -x86_64 python3 -c 'import _tkinter;\
               print(_tkinter.__file__)')

-- 
 Ned Deily,
 nad at acm.org



More information about the Tkinter-discuss mailing list