[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] condor_submit problems: _gtk.init_check(), RuntimeError: could not open display



Hi Chris:

On Wed, 2011-11-16 at 11:51 -0500, Ian Chesal wrote:
> On Wednesday, 16 November, 2011 at 11:40 AM, Christopher Prokop wrote:
> > Hi,
> > 
> > 
> > I am encountering a strange error when using condor_submit.
> > Executing a script on my own works fine without errors, but when I
> > try to run it using condor_submit, I get the following errors when
> > trying to import from pylab or pylot from matplotlib:
> > 
> > 
> > File
> > "../Local_Install//lib/python2.4/site-packages/matplotlib/pyplot.py",
> > line 95, in ?
> > File
> > "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/__init__.py",
> > line 25, in pylab_setup
> > File
> > "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py",
> > line 10, in ?
> > File
> > "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
> > line 8, in ?
> > File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py",
> > line 76, in ?
> > _init()
> > File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py",
> > line 64, in _init
> > _gtk.init_check()
> > RuntimeError: could not open display
> Your script is expecting to be able to connect to an active display.
> In this case it looks like it's looking for an X display session. Some
> tools require this even if you're not running anything graphical.
> Apparently matplotlib is one of those libraries.
> 
> 
> You'll either need to figure out how to stop matplotlib from looking
> for an active display. Preventing it from loading the GTK library is
> probably your best way to solve this.

Going along with Ian's great suggestion - you may just want to choose a
different matplotlib backend (i.e. one that does not require an X
session).

There is some documentation on the matplotlib website that shows how to
do this:
http://matplotlib.sourceforge.net/faq/howto_faq.html#generate-images-without-having-a-window-appear
Rather than opening up plot windows, you would just save the resulting
images to a file (png, jpeg, pdf, etc.) and have Condor transfer them
back when your job completes. 

Cheers,
DJH