[Tutor] Modules

eryksun eryksun at gmail.com
Thu Mar 28 00:05:53 CET 2013


On Wed, Mar 27, 2013 at 5:09 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> Tkinter is an unusual module in that it requires support for Tcl/Tk to be
> compiled into the interpreter. This is not always the case.

The _tkinter module is a C extension that links to Tcl/Tk. On Debian
Linux, _tkinter (_tkinter.so) is in the package python-tk /
python3-tk. The ImportError raised by "import tkinter" suggests the
required package. Except for Python 3.2 it incorrectly suggests the
2.x package:

    ImportError: No module named _tkinter, please install the
    python-tk package

IIRC the official Python installer on Windows defaults to installing
tkinter, but it is optional.


More information about the Tutor mailing list