can not run a TCL demo python script.

antifod at antifod at
Tue Mar 4 21:59:38 CET 2003


I am working on a Win NT machine. I have installed Python in C:/Python
and TCL in C:/Program Files/Tcl. The problem is that I can't run the
demo python script C:\Program Files\Tcl\demos\Tktable\ from
Python. The script exits with an error message in the following
sequence of statements
  'package', 'require', 'Tktable')
        except Tkinter.TclError:
  'load', '', 'Tktable')
The error that it throws is
  File "C:\Program Files\Tcl\demos\Tktable\", line 68, in
__init__'load', '', 'Tktable')
TclError: package "Tktable" isn't loaded statically

I tried the following variant of the above code\
:---------------'package', 'require', 'Tktable')
##        except Tkinter.TclError:
##  'load', '', 'Tktable')
        Tkinter.Widget.__init__(self, master, 'table', cnf, kw)
.. and it threw the following error
  File "C:\Program Files\Tcl\demos\Tktable\", line 66, in
__init__'package', 'require', 'Tktable')
TclError: can't find package Tktable

So, the problem looks like a path configuration problem. The *.tcl
scripts in the directory as the *.py script run just fine under TCL. I
have edited the PYTHONPATH environment to include the TCL\demos,
TCL\bin, TCL\lib, and TCL\include directories.

Does anybody know where TCL/TK gets its path to search packages from?
In this case for example, I don't know which file TK is trying to
"require". Is it one of the files in the tcl/include, tcl/lib or
another directory altogether?


More information about the Python-list mailing list