Tkinter._test() problem Tcl/Tk8.1 incompatibility python-1.5.2

Gernot Krause gkr at is.in-berlin.de
Tue Jul 6 04:50:31 EDT 1999


>> -----cut
>> >>python
>> Python 1.5.2 (#4, Jul  4 1999, 12:25:56)  [GCC egcs-2.91.66 19990314
>> (egcs-1.1.2  on linux2
>> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>> >>> import Tkinter
>> >>> Tkinter._test()
>> Traceback (innermost last):
>>   File "<stdin>", line 1, in ?
>>   File "/per/lib/python1.5/lib-tk/Tkinter.py", line 1947, in _test
>>     root = Tk()
>>   File "/per/lib/python1.5/lib-tk/Tkinter.py", line 886, in __init__
>>     self.tk = _tkinter.create(screenName, baseName, className)
>> TclError: Can't find a usable init.tcl in the following directories:
>>
>> This probably means that Tcl wasn't installed properly.
>> ----cut
>>
>> It seems, that python looks in some directories, which it does not
>> have. What do I have to do?


Hi,


if tk not installed in standard path (see --prefix in source code if you
have it compiled), than you must set the environment variable
TK_LIBRARY. The value contains the path, on which installed the tk files.
You can set also TK_PATH. For tcl you can set  TCL_LIBRARY,
TCL_PATH and TCL_PROGRAMS for your environment.
Please read the documentation in /usr/doc/packages/tk*
or  /usr/doc/packages/tcl*.

Gernot Krause








More information about the Python-list mailing list