Tkinter/Tcl8.1: can't find init.tcl

rey at esrf.fr rey at esrf.fr
Mon Oct 11 07:41:37 EDT 1999


I found the following problem when compiling Python with tkinter
on top of a Tcl/Tk 8.1 installation.

The following error appears:
-----
>>> from Tkinter import *
>>> root=Tk()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/users/rey/mypython/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.
-----

The problem actually comes from the fact that from Tcl8.1 onwards a
call to Tcl_FindExecutable() is necessary when initializing Tcl.

I added that line to the _tkinter.c file and it works

Python-1.5.2/Modules/_tkinter.c:

function: Tkapp_New()
[...]
        ckfree(argv0);

        /* My code */
        Tcl_FindExecutable(argv0);

        if (Tcl_AppInit(v->interp) != TCL_OK)
                return (TkappObject *)Tkinter_Error((PyObject *)v);


I think it may help.

Vicente REY


Sent via Deja.com http://www.deja.com/
Before you buy.




More information about the Python-list mailing list