[Tutor] Tkinter import error
Alan Gauld
alan.gauld at btinternet.com
Tue Apr 24 01:09:21 CEST 2007
"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.
> make sure that "Tkinter.py" exists in the path shown in the error,
> and
> it is there (dated the last time I recompiled Python 2.5).
I don't think its the .py file is the problem its the library that the
.py
file wraps.
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list