Problem with Tkinter

Martin v. Loewis martin at v.loewis.de
Fri Mar 29 17:23:10 EST 2002


"Cyr" <cd.cd at wanadoo.fr> writes:

> Python has been installed on another station in a common directory and
> Tkinter works great on the other station. But the Tk library isn't in a
> common directory. On this station (srv0023), I only have Tcl/Tk 8.0 (and no
> library in the directories mentioned in the error message). Is there any way
> I can configure python so that it would use Tk 8.0 library on the station
> but continue to use Tk 8.3 on the other station ? 

It is possible, but difficult. You need to compile _tkinter.so twice,
once linking it with Tk 8.0, and once linking it with Tk 8.3. That
requires that you have both versions installed on the build station,
including header files for both versions.

> In fact, I wonder how I can change the path search for the Tk
> library within python.

You need to edit Modules/Setup to direct make to a specific Tkinter
location. In doing so, you must uncomment the *shared* line in Setup,
since it will otherwise build _tkinter directly into the Python
executable.

HTH,
Martin




More information about the Python-list mailing list