Use a locally built Tk for Python?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Jun 3 12:28:03 EDT 2012


On Fri, 01 Jun 2012 09:34:41 -0700, Mark Summerfield wrote:

> Hi,
> 
> I have multiple Pythons locally installed so that I can test against
> different versions. (On a 64-bit Debian stable system.)
[...]
> But when I run ~/opt/py32tkmod/bin/python3 tkinter-test.pyw the system
> tk is being used not my customized one.
> 
> Can anyone advise?

I'm not sure if this will help, but it may. I had a similar problem where 
my Python couldn't see my installed tk/tcl 8.5 in /usr/local/lib. The 
symptom I got was that "make install" was not building _tkinter and 
reported this warning:

    *** WARNING: renaming "_tkinter" since importing it failed:
    libtk8.5.so: cannot open shared object file: No such file or directory



I fixed this by using these commands as root:


echo /usr/local/lib > /etc/ld.so.conf.d/python27.conf
ldconfig

then running "make clean", "make", "sudo make altinstall" again.

(I used altinstall instead of install so as to avoid changing the system 
Python.)

This was on a 32-bit Centos system, but I expect it should work just as 
well on a 64-bit Debian system.



-- 
Steven



More information about the Python-list mailing list