python, tkInter -> tcl/tk problems

martin.lemburg at bigfoot.de martin.lemburg at bigfoot.de
Sun Jul 11 07:03:33 EDT 1999


Hi,

I would be glad to get some help belonging to the use of tkInter with python 1.5.2!

The situation:

1. I already have tcl/tk 8.05 installed
2. tcl/tk is inside the path of WindowsNT
3. starting idle returns following error message: 
>Traceback (innermost last):
>  File "E:\programming\Python\Tools\idle\idle.py", line 3, in ?
>    PyShell.main()
>  File "E:\programming\Python\Tools\idle\PyShell.py", line 611, in main
>    root = Tk()
>  File "E:\programming\Python\Lib\lib-tk\Tkinter.py", line 893, in __init__
>    self.tk = _tkinter.create(screenName, baseName, className)
>TclError: Can't find a usable init.tcl in the following directories:
>    {} ./lib/tcl8.0 E:/programming/Python/tcl8.0/library E:/programming/Python/Tools/library

My tries to solve the problem:

1. I copied the lib/tcl8.0 directory from my tcl/tk installation into the python directory:
    <tcl/tk>/lib/tcl8.0    =>    <python>/tcl8.0/library
2. I copied the lib/tk8.0 directory from my tcl/tk installation into the python directory:
    <tcl/tk>/lib/tk8.0    =>    <python>/tk8.0/library

New situation:

1. starting idle returns following error message:
>Traceback (innermost last):
>  File "E:\programming\Python\Tools\idle\idle.py", line 3, in ?
>    PyShell.main()
>  File "E:\programming\Python\Tools\idle\PyShell.py", line 611, in main
>    root = Tk()
>  File "E:\programming\Python\Lib\lib-tk\Tkinter.py", line 893, in __init__
>    self.tk = _tkinter.create(screenName, baseName, className)
>TclError: Can't find a usable tk.tcl in the following directories:
>    . E:/programming/Python/tcl8.0/tk8.0 ./tk8.0 ./lib/tk8.0 ./library ./tk8.0/library
> ./library E:/programming/Python/tk8.0/library
>
>E:/programming/Python/tk8.0/library/tk.tcl: bad event type or keysym "MouseWheel"
>bad event type or keysym "MouseWheel"
>    while executing
>"bind Listbox <MouseWheel> {
>    %W yview scroll [expr - (%D / 120) * 4] units
>}"
>    (file "E:/programming/Python/tk8.0/library/listbox.tcl" line 179)
>    invoked from within
>"source [file join $tk_library listbox.tcl]"
>    (file "E:/programming/Python/tk8.0/library/tk.tcl" line 151)
>    invoked from within
>"source E:/programming/Python/tk8.0/library/tk.tcl"
>    ("uplevel" body line 1)
>    invoked from within
>"uplevel #0 [list source $tkfile]"

What know?

The tcl/tk-version delivered by python 1.5.2 is 8.0.5 too, so what goes wrong?
Why does python/tkInter looks for tcl/tk in non tcl/tk-standard directories?
What could I do to activate tkInter to use it with python 1.5.2?

I would be glad reading something from you - but it would be nice to email me your answers too!

Bye

Martin Lemburg

____________________________________________

Martin Lemburg
Bielfeldtstraße 12 - D-22763 Hamburg
Tel./Ph.   +49 (40)  8803486
Fax.        +49 (441) 800 990 6462
eMail.    martin.lemburg at bigfoot.de






More information about the Python-list mailing list