Configuring Python for Tk on Mac

Jim Sizelove sizelji at insightbb.com
Fri Jan 21 14:51:14 EST 2005


Martyn Quick wrote:
> On my desk here at work I have a Mac G4 running Mac OS X v10.2.8.
> 
> When I go into a terminal and type "python" up comes a nice python
> interface and all seems great.  However when I type "import Tkinter"
> I'm greeted by the following error.
> 
> 
>>>>import Tkinter
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 35, in ?
>     import _tkinter # If this fails your Python may not be configured
> for Tk
> ImportError: No module named _tkinter
> 
> So I guess something about this implementation is not appropriately
> configured.  I'm guessing this is the default behaviour since I don't
> think anyone did anything special about python when they set up my
> machine.
> 
> What do I do to set it up so I can use Tkinter?
> 
> Thanks... and sorry if this is an FAQ... but I couldn't find the info
> easily.
> 
> Yours,
> Martyn


You probably need to install Tcl/Tk Aqua:
	http://tcltkaqua.sourceforge.net

After downloading and installing on my Mac running OS X v 10.2, I am 
able to open IDLE and other Tk apps.

HTH,

Jim Sizelove



More information about the Python-list mailing list