www.pythonware.com products ::: library ::: search ::: daily Python-URL!

Products

Tkinter

Frequently Asked Questions :::

A Django site.
   

Frequently Asked Questions

I Get "Cannot find a usable tk.tcl in the following directories"

This means that Tk cannot find it's library (the .tcl files found under something/library), or that it picks up the wrong version of these files. Here's how to solve this:

  • Place a copy of the Tcl/Tk lib directory at ..\lib (relative to the Python bin directory, that is).
  • Or set the TCL_LIBRARY and TK_LIBRARY environment variables to point to the Tcl and Tk library directories.
  • Or edit the registry. (If you cannot figure out how, you probably shouldn't try this)

I Get "bad event type or keysym MouseWheel"

This means that you're using a fresh Tk library (the .tcl files found under something/library) with an old DLL. Maybe you have old Tcl/Tk DLL's in the system directory (see below).

Tkinter Complains About A Non-Functioning Device

This is Windows way of telling you that it cannot find a certain DLL.

The Tcl installer puts the DLL's in the same directory as the EXE files. Since Windows searches in the EXE directory before it looks in any other directory, Tcl works even if you don't have the Tcl executables in the PATH.

However, Python cannot find it, unless you do one of the following:

  • Put a copy of the Tcl/Tk DLL's in the directory where you have your python.exe . You'll find the DLL's in \program files\tcl\bin (if you're doing this on a non-US platform, "program files" is probably something else).
  • Or add the Tcl bin directory to the PATH (if you're using Windows 9X, you can do this by editing autoexec.bat).
    Note: According to some reports, you have to use the "short form" of the directory name; typically c:\progra~1\tcl\bin (use the dir command to figure out what this is on your box).
  • Or put a copy of the Tcl/Tk DLL's in the \windows\system directory (this directory is always in the path). On NT, use \winnt\system32 instead.

Note: Given that only some people stumble upon this problem, we suspect the Tcl/Tk installer, or some earlier version of it, does something like this under certain circumstances. If someone knows for sure, drop us a line.