Problem running python/matplotlib in background after ending ssh session Problem running python/matplotlib in background after ending ssh session tkinter tkinter

Problem running python/matplotlib in background after ending ssh session


I believe your matplotlib backend requires X11. Look in your matplotlibrc file to determine what your default is (from the error, I'm betting TkAgg). To run without X11, use the Agg backend. Either set it globally in the matplotlibrc file or on a script by script by adding this to the python program:

import matplotlibmatplotlib.use('Agg')


It looks like you're running in interactive mode by default, so matplotlib wants to plot everything to the screen first, which of course it can't do.

Try putting

ioff()

at the top of your script, along with making the backend change.

reference: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.ioff


Sorry if this is a stupid answer, but if you're just running a console session, would 'screen' not suffice? Detachable sessions, etc.