I’m trying to ssh into a server and run a python script on it.
I keep getting the error when I run the command on a mac.
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 443, in clf
gcf().clf()
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 369, in gcf
return figure()
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 343, in figure
**kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 80, in new_figure_manager
window = Tk.Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1688, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
I’m using ssh -X abc@xyz.com to ssh. This works without any problem on ubuntu but gives this error on mac. I have just shifted to mac and I don’t understand what I’m doing wrong here.
Do you have XQuartz installed?
$DISPLAYshould be automatically set on OS X to a launchd socket which will automatically launch XQuartz when accessed. A common mistake is setting$DISPLAYto :0.0, but I think that would cause a different error.Here’s how things should look: