OS X and Tkinter

Piet van Oostrum piet at cs.uu.nl
Mon Mar 14 16:56:04 EST 2005


>>>>> Mike Tuller <python at discovercommunityed.com> (MT) wrote:

>MT> I recently purchased a book to learn python, and am at a part where I  want
>MT> to start working with GUIs. I have an OS X system, and am using  the
>MT> default python installed on the system. I have installed Tcl/Tk  Aqua from
>MT> http://tcltkaqua.sourceforge.net/.

>MT> When I run the file called gui.py that contains this:

>MT> from Tkinter import *
>MT> root = Tk()
>MT> root.title("Simple GUI")
>MT> root.geometry("200x100")

>MT> I get this back:

>MT> python gui.py
>MT> Traceback (most recent call last):
>MT>    File "gui.py", line 1, in ?
>MT>      from Tkinter import *
>MT>    File  "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
>MT>    python2.3/lib-tk/Tkinter.py", line 38, in ?
>MT>      import _tkinter # If this fails your Python may not be configured  for
>MT>      Tk
>MT> ImportError: No module named _tkinter

>MT> I have looked everywhere on the net, and can't figure out how to  configure
>MT> python so that Tkinter will work with it. Any help would be  appreciated.

You need to install Tkinter. The easiest way is to use the Python Package
Manager: http://www.python.org/packman/
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list