I have a Tkinter application that ran fine in OS X 10.7.5. Recently, when I upgraded to 10.9.2, it ceased to run, throwing this error:
Traceback (most recent call last):
File "roiTracker.py", line 5127, in <module>
startTracker(filename=filename)
File "roiTracker.py", line 5111, in startTracker
tk = TK.Tk()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1745, in _init_
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
Tkinter and python versions:
user:Desktop user$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> Tkinter.__version__
'$Revision: 81008 $'
>>> exit()
Contents of $DISPLAY
variable:
user:Desktop user$ echo $DISPLAY
user:Desktop user$
As per this similar-sounding problem, I tried
launchctl load -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
and got
Couldn't stat("/Library/LaunchAgents/org.macosforge.xquartz.startx.plist"): No such file or directory
nothing found to load
Not sure if that was naive or not - I'm pretty ignorant about how the windowing backends work.
I am running all of these commands locally.
Thank you for your help!