Idle (Python) on OS X Mavericks

Joshua Root jmr at macports.org
Tue May 27 19:04:24 PDT 2014


> Ok, I’ve got python2.7 and 3.4 from Macports installed. I’m trying to use idle but the error printed is:
> 
> ** IDLE can’t import Tkinter. Your Python may not be configured for tk **
> 
> I also installed the py34-tkinter port as I believe this port contains the required libraries for Idle. The same error is printed. 
> 
> Could it be a $PATH issue or missing libraries issue or both?
> 
> PATH is currently set to: 
> 
> /Users/jamie/bin:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/Users/jamie/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
> 
> Some repetition of directories but that shouldn’t cause a problem (I don’t think)
> 
> Would anyone be able to offer some advice/info?

How are you starting IDLE? I just installed python34 and py34-tkinter
and double-clicking on /Applications/MacPorts/Python 3.4/IDLE.app works
fine. (If you want to run /Applications/MacPorts/Python 2.7/IDLE.app
then of course you would need py27-tkinter.)

PATH should have no effect here. PYTHONPATH could, though it would have
to be set globally by launchd to affect an app launched from Finder.
There are various other ways that sys.path can be modified in python,
and these could certainly stop the tkinter module from being found.

- Josh


More information about the macports-users mailing list