Search code examples
pythonbuildsuse

Python 2.7.2 install on Suse Linux Server 11.3 can't find tkinter dependencies


I've spent hours on this. Seems like our job on Linux is to debug scripts that don't work across the fragmented distros rather than getting work done.

Setup.py tries to find what it needs and build the c modules used to wrap certain dependencies if it can find what it needs. This makes the script super fragile relative to paths and file names.

While it is VERY hard to tell from the .py source, it seems for tkinter we need tcl, tk, and tix. Latest versions of these are all installed. I can verify this because Python 2.6 that comes with the SUSE distro imports_tkinter and Tkinter modules and runs the test script correctly.

The script seems to need to find the libraries. I have both 32 bit and 64 bit installed. So, these libraries exist: 32bit 64bit libtk8.5.so /usr/lib /usr/lib64 libtcl8.5.so " "

Both paths are included in the appropriate search list in Setup.py. But, I don't think Setup.py searches for the correct file names. It seems to search for files that begin with tk and tcl, catenating a variety of different versions (including '8.5'). But, the file names don't begin with 'lib'. Before I begin tampering more, could the Python.org folks have really messed this up so badly? That doesn't seem likely. Is SUSE Linux so odd a distro? This doesn't seem likely either.

I don't think setup.py would look for the binaries (would matter at run time it would seem...) but they are present in usr/lib and usr/lib64.

The only include file I can find is for tclextend. It is tclextend.h found in usr/include. I could not find other .h files for tcl or tk. Of course the include files that the Python c wrappers require are supplied with the download of Python 2.7.

So, I am kind of at my wit's end. This is such a colossal waste of time. Is there a way to just skip the build process and just build the tcl/tk support? I also have the same problem with ssl: it would not build. One thing at a time.

Thanks for your help.


Solution

  • I found many distribution points for sets of rpm packages. This enabled me to install individual packages such as the headers for tcl. But, this was a bad approach because the full dependency hierarchy to build Python support for tkinter is something on the order of 60 packages.

    I found that the OpenSuSE repository for version 11.3 of the OS contained everything I needed. My Novell distro came with Novell's repositories which exclude nearly all devel packages.

    Problem solved. The make of python found all of the prerequisites for tkinter.

    Sorry to post such a nube question.