This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: OS X Installer: add checks to ensure proper Tk configuration during build
Type: Stage:
Components: Build, macOS Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: Katrine.Whiteson, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2009-04-01 16:16 by ned.deily, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-nad0012.txt ned.deily, 2009-04-01 16:16
Messages (9)
msg85033 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-04-01 16:16
Because OS X 10.4 and 10.5 ship with an old 8.4 version of Aqua Tcl and 
Tk frameworks, current practice is to build the installer image on a 
machine with user-installed newer 8.4 Tcl/Tk frameworks in /Library.  
This ensures the correct dylib search sequence is built into the Python 
image so that users can install a newer 8.4 on their own systems and, if 
not, Python will fallback to the Apple-supplied versions in 
/System/Library.  It is easy to overlook this step in the build process, 
however, and some installer images in the past inadvertently did not 
include this capability.

This patch adds checks to the build-installer script to ensure that the 
newer frameworks are installed on the build machine so that the magic 
happens.

Note, Python tkinter currently only supports linking with one 
major/minor version of Tcl and Tk so this magic does not allow the 
Python installer image to use a major/minor version other than the 
current system version.
msg99257 - (view) Author: Katrine Whiteson (Katrine.Whiteson) Date: 2010-02-12 08:50
Hi,

I am having a related issue installing Tkinter (which I need to install matplotlib).

I am running Mac OS X 10.4.11, and just installed Python 2.6.4 .

After several other fights, one remaining battle for me to get matlotlib installed is to have a working version of Tkinter, although there are several in my Mac from Xcode and also Python, I guess they just aren't installed in useful places? After I installed Python 2.6.4, import _tkinter failed. So I installed Tcl 8.5 from active state.

Now, I make it to the Tkinter test:

            Tkinter._test() Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 3746, in _test root = Tk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1645, in init self._loadtk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5)

I realize you have discussed the exact error I am describing here: http://bugs.python.org/issue4017

but those errors arose from a problem with an earlier version of python, where setup.py reversed the order of where to look. The advice in your previous post is to fix this order in setup.py and rebuild python, but my setup.py is already looking good - it includes these lines:

def detect_tkinter_darwin(self, inc_dirs, lib_dirs): # The _tkinter module, using frameworks. Since frameworks are quite # different the UNIX search logic is not sharable. from os.path import join, exists framework_dirs = [ '/Library/Frameworks', '/System/Library/Frameworks/', join(os.getenv('HOME'), '/Library/Frameworks')

I would really appreciate any insight on how to handle this!( I am a biologist...)

While I'm at it, I'll include what is going on when I try to install m matplotlib in case it is useful...matplotlib thinks I have Tkinter 8.4 (ironically, only after I installed 8.5, before that it always said it could not find Tkinter):

Tkinter: Tkinter: 65971, Tk: 8.4, Tcl: 8.4

also, here is the error I run into when trying to build matplotlib:

powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' i686-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' /usr/bin/ld: -syslibroot: multiply specified collect2: ld returned 1 exit status /usr/bin/ld: -syslibroot: multiply specified collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccrblCgU.out (No such file or directory) error: command 'g++' failed with exit status 1 make: * [mpl_build] Error 1

thank you!!

Katrine
msg99259 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-02-12 10:32
If you have installed Python 2.6.4 using the python.org OS X installer, it was linked with Tk 8.4, and will not use Tk 8.5.  OS X 10.4 has an old version of Tk 8.4; your best bet is to install the most recent Tcl/Tk 8.4 from ActiveState Tcl/Tk.
msg99262 - (view) Author: Katrine Whiteson (Katrine.Whiteson) Date: 2010-02-12 11:40
Thanks very much for your helpful and quick reply!

I installed Tcl8.4 from activestate, and had the same version  
conflict error when I did the Tkinter test in Python. So I  
uninstalled both Tcl8.4 and Tcl8.5 (I did sudo ./uninstall while in  
this directory, the 8.4 and 8.5 versions:  /Library/Receipts/ 
ActiveTcl-8.4.pkg/Contents/Resources)

Then I reinstalled Tcl8.4 from active state, and now it still seems  
to look for Tcl8.5 when I say "import _tkinter" in Python:

katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$ python
Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import _tkinter
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/ 
lib/python2.6/lib-dynload/_tkinter.so, 2): Library not loaded: / 
Library/Frameworks/Tcl.framework/Versions/8.5/Tcl
   Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/ 
lib/python2.6/lib-dynload/_tkinter.so
   Reason: image not found

____________________

I looked in /Library/Frameworks/Tcl.framework

and found 2 folders, "8.4" and "Current", the latter does not contain  
anything that says 8.5.

How can I get python to stop looking for 8.5?

thank you!
Katrine

On Feb 12, 2010, at 11:32 AM, Ned Deily wrote:

>
> Ned Deily <nad@acm.org> added the comment:
>
> If you have installed Python 2.6.4 using the python.org OS X  
> installer, it was linked with Tk 8.4, and will not use Tk 8.5.  OS  
> X 10.4 has an old version of Tk 8.4; your best bet is to install  
> the most recent Tcl/Tk 8.4 from ActiveState Tcl/Tk.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5651>
> _______________________________________
msg99272 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-02-12 16:14
Katherine: how did you install Python, did you use the installer on the python.org website or some other installer (or even by building from source)?
msg99280 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-02-12 18:44
Ah, earlier you said you installed Python 2.6.4 but, in your most recent message, it shows:

katrinewhiteson$ python
Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin

I'm not sure what that is but it's not python 2.6.4 nor a python.org python nor an Apple-supplied python.  So chances are it was linked with Tk 10.5 present on the system.  Type:
which python
to find out where this one is installed and, if necessary, remove it and re-install a python, like from the python.org installer, that was linked with Tk 8.4.  You then should see something like this:

Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
msg99346 - (view) Author: Katrine Whiteson (Katrine.Whiteson) Date: 2010-02-14 22:29
Hi,

Wow, thank you for noticing this. I tried to install python 2.6.4  
with the mac dmg, but couldn't figure out where it was installed.  I  
hunted around and made a link to a python 2.6 that I found - it must  
have been a previous version.

Now I have a fresh and successful python 2.6.4 install, Tkinter test  
works, and so I should be set.

I am still having trouble building matplotlib. Apparently my  
syslibroot is multiply specified. (I installed Xcode 2.2.1 from the  
mac developer site recently, by the way...). If you understand this,  
I would really appreciate any insight you have (I am attaching the  
output from when I try to build matplotlib).

thank you!!
Katrine

python2.6 setup.py build
======================================================================== 
====
BUILDING MATPLOTLIB
             matplotlib: 0.99.1.1
                 python: 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)   
[GCC
                         4.0.1 (Apple Inc. build 5493)]
               platform: darwin

REQUIRED DEPENDENCIES
                  numpy: 1.3.0
              freetype2: found, but unknown version (no pkg-config)
                         * WARNING: Could not find 'freetype2'  
headers in any
                         * of '.', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
                 libpng: found, but unknown version (no pkg-config)
                         * Could not find 'libpng' headers in any of '.'
                Tkinter: Tkinter: 73770, Tk: 8.4, Tcl: 8.4
               wxPython: no
                         * wxPython not found
                   Gtk+: no
                         * Building for Gtk+ requires pygtk; you must  
be able
                         * to "import gtk" in your build/install  
environment
        Mac OS X native: yes
                     Qt: no
                    Qt4: no
                  Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
               datetime: present, version unknown
               dateutil: matplotlib will provide
                   pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
                 dvipng: no
            ghostscript: /bin/sh: line 1: gs: command not found
                  latex: no

[Edit setup.cfg to suppress the above messages]
======================================================================== 
====
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',  
'matplotlib.projections', 'mpl_toolkits', 'mpl_toolkits.mplot3d',  
'mpl_toolkits.axes_grid', 'matplotlib.sphinxext',  
'matplotlib.numerix', 'matplotlib.numerix.mlab',  
'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',  
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',  
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.4- 
fat-2.6/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/ 
lib.macosx-10.4-fat-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
c++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g  
-bundle -undefined dynamic_lookup -arch i386 -arch ppc -L/usr/local/ 
lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc - 
I/usr/local/include -I/usr/local/include/freetype2 -isysroot / 
Developer/SDKs/MacOSX10.4u.sdk build/temp.macosx-10.4-fat-2.6/src/ 
ft2font.o build/temp.macosx-10.4-fat-2.6/src/mplutils.o build/ 
temp.macosx-10.4-fat-2.6/CXX/cxx_extensions.o build/temp.macosx-10.4- 
fat-2.6/CXX/cxxsupport.o build/temp.macosx-10.4-fat-2.6/CXX/ 
IndirectPythonInterface.o build/temp.macosx-10.4-fat-2.6/CXX/ 
cxxextensions.o -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.4- 
fat-2.6/matplotlib/ft2font.so
powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/ 
Developer/SDKs/MacOSX10.4u.sdk'
i686-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/ 
Developer/SDKs/MacOSX10.4u.sdk'
//usr/bin/ld: -usr/syslibroot: multiply specified
bincollect2: /ld: -syslibroot: multiply specified
ld returned 1 exit statuscollect2:
ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccym1XU1.out (No such file or  
directory)
error: command 'c++' failed with exit status 1
make: *** [mpl_build] Error 1
katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$ gcc -V
gcc: argument to `-V' is missing
katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$ which gcc
/usr/bin/gcc
katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$   c f yj ny
-bash: c: command not found
katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$ k/l
-bash: k/l: No such file or directory

On Feb 12, 2010, at 7:44 PM, Ned Deily wrote:

>
> Ned Deily <nad@acm.org> added the comment:
>
> Ah, earlier you said you installed Python 2.6.4 but, in your most  
> recent message, it shows:
>
> katrinewhiteson$ python
> Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04)
> [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
>
> I'm not sure what that is but it's not python 2.6.4 nor a  
> python.org python nor an Apple-supplied python.  So chances are it  
> was linked with Tk 10.5 present on the system.  Type:
> which python
> to find out where this one is installed and, if necessary, remove  
> it and re-install a python, like from the python.org installer,  
> that was linked with Tk 8.4.  You then should see something like this:
>
> Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5651>
> _______________________________________
msg99348 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-02-14 22:57
Katrine, good that you are making progress.  But since your current problem has nothing to do with Issue5651 or with Python itself, suggest you ask on a more appropriate forum; see, for instance, http://matplotlib.sourceforge.net/users/installing.html#build-osx or comp.lang.python / python-list.
msg103499 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-04-18 15:25
I've committed the patch in r80179 (trunk), r80184 (2.6), r80185 (3.2), r80186 (3.1)
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49901
2010-04-18 15:25:36ronaldoussorensetstatus: open -> closed
resolution: fixed
messages: + msg103499
2010-04-15 09:57:03ned.deilysettitle: OS X Installer: add checks to ensure proper Tcl configuration during build -> OS X Installer: add checks to ensure proper Tk configuration during build
2010-04-15 09:53:31ned.deilysetassignee: ronaldoussoren
nosy: ronaldoussoren, ned.deily, Katrine.Whiteson
components: + macOS
versions: + Python 3.2, - Python 3.0
2010-02-14 22:57:59ned.deilysetmessages: + msg99348
2010-02-14 22:29:49Katrine.Whitesonsetmessages: + msg99346
2010-02-12 18:44:53ned.deilysetmessages: + msg99280
2010-02-12 16:14:07ronaldoussorensetmessages: + msg99272
2010-02-12 11:40:48Katrine.Whitesonsetmessages: + msg99262
2010-02-12 10:32:30ned.deilysetmessages: + msg99259
2010-02-12 08:50:53Katrine.Whitesonsetnosy: + Katrine.Whiteson
messages: + msg99257
2009-04-01 16:16:51ned.deilycreate