[Tutor] Tkinter import error

Michael Lange klappnase at freenet.de
Tue Apr 24 11:26:00 CEST 2007


On Tue, 24 Apr 2007 00:09:21 +0100
"Alan Gauld" <alan.gauld at btinternet.com> wrote:

> 
> "John DeStefano" <john.destefano at gmail.com> wrote
> 
> > I've run into an error that I've seen reported in several places, 
> > but
> > none of the fixes seem to be working for me: when I try to "import
> > Tkinter" I get a configuration error:
> > Traceback (most recent call last):
> >  File "<stdin>", line 1, in <module>
> >  File "/usr/local/lib/python2.5/lib-tk/Tkinter.py", line 38, in 
> > <module>
> >    import _tkinter # If this fails your Python may not be configured 
> > for Tk
> > ImportError: No module named _tkinter
> 
> Have you specifically selected Tkinter when you compiled the code?
> I believe you need to set something via configure... Alternatively
> find an rpm with Tkinter configured already, that should be pretty
> easy.

Usually there is no need to pass extra arguments to configure.
My guess is that you missed to install Tcl / Tk and/or the Tcl/Tk development
packages before compiling python.

Michael



More information about the Tutor mailing list