ImportError: No module named _tkinter

john at cs.york.ac.uk john at cs.york.ac.uk
Fri Aug 24 12:58:53 EDT 2001


I've just successfully compiled Python 2.2a1 from source on
a Linux system, and got it to work with Tcl/Tk 8.3.3 without
any problem. When I do the same on a Solaris 2.6 system - the
difference being the location of the various include and library
files, I get the (well-known) messages:

$ python calc1.py
Traceback (most recent call last):
  File "calc1.py", line 1, in ?
    from Tkinter import *
  File "/usr/local/python-2.2a1/lib/python2.2/lib-tk/Tkinter.py", line 35, in ?
    import _tkinter # If this fails your Python may not be configured for Tk
$

I've stared at the alterations to the copy of the text from the
Setup file I've made in Setup.local, and can't see my mistake. I've
read the Python FAQ, and google(-grouped) for a similar problem
encountered by someone else. I've tested my installation of Tcl/Tk
and it's fine. I've tried an earlier version of Tcl/Tk I had
installed, and Python fails with the same error messages.

If all else fails, how can one debug the Python Tkinter configuration?

John A. Murdie



More information about the Python-list mailing list