What happened to _tkinter.so?

akineko akineko at gmail.com
Sun Jun 29 01:43:08 EDT 2008


Hello,

I spent time today to investigate this.
If you install Python with Tkinter from source, _tkinter is built into
the Python executable and _tkinter.so is not generated *unless*
"shared" option is specified.

I found this by running python with '-v' option:
% python -v
...
>>> from Tkinter import *
...
import _tkinter # builtin  <<<---

In the Module/Setup file:
# Uncommenting the following line tells makesetup that all following
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):

#*shared*

I tried to uncomment the line and I got successfully _tkinter.so under
python2.5/lib-dynload directory.

This may be an issue for PyInstaller as it relys on _tkinter.so to
find the path to TCL/TK.
However, many Linux distribution includes _tkinter.so as many people
complained about missing _tkinter.so.
So, this is not really an issue unless you install Python by yourself.

Aki-

On Jun 26, 6:00 pm, akineko <akin... at gmail.com> wrote:
> Hello Python developers,
>
> I have noticed something curious while I was investigating a problem
> with the PyInstaller.
>
> In my environment, the PyInstaller couldn't find TCL/TK installation
> path even I have it.
> I found the PyInstaller uses output from ldd <dynamic link libary> to
> find the a path to TCL/TK libraries.
> But no dynamic libraries under my Python 5 lib-dynload directoty
> contain a path to TCL/TK libraries.
>
> When I posted this problem to the PyInstaller newsgroup, a guy
> responded that he didn't have such problem.
> After several exchanges, what we found was his lib-dynload directory
> contains_tkinter.so (even he has the same Python2.5.2) while my lib-
> dynload directory doesn't have it.
>
> He installed the Python using package tool (no fresh compile) while I
> installed my Python from src (clean compile).
>
> I recompiled Python 2.4 and confirmed that Python 2.4 creates_tkinter.so.
> After browsing the Makefile under Python 2.5, I had an impression that
> Python 2.5 no longer uses_tkinter.so.
>
> Am I correct?
> If that is the case, I need to warn the PyInstaller developers that
> the scheme to find TCL/TK path is no longer valid.
>
> Any comments will be highly appreciated.
>
> Thank you for your attention.
> Aki Niimura




More information about the Python-list mailing list