SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Eric E. <ems...@ob...> - 2008年12月30日 23:05:18
Hi,
I am trying to run a relatively large code, which includes some calls to and
import from pylab/matplotlib, on a remote machine: the part of the code I am
running is NOT performing any plot so there is no direct access to a display.
Unfortunately it still crashes with something like:
---> 40 cursors.MOVE : gdk.Cursor(gdk.FLEUR),
 41 cursors.HAND : gdk.Cursor(gdk.HAND2),
 42 cursors.POINTER : gdk.Cursor(gdk.LEFT_PTR),
RuntimeError: could not create GdkCursor object
when it tries to reach the display when importing pylab I guess.
I am now doing this from my laptop from a non-fixed IP and there is no easy way
for me to forward the display (loging e.g. with ssh -X), or to just isolate the
pylab part of the code (lots of files, lots of lines, etc).
I am desperately trying to run this long calculation on that remote machine (and
do it while my laptop is off, using "screen") because I need a lot of memory and
CPU.... How can I overpass this easily (just allowing for the code not to crash
with that initialisation and go on with the rest) ???
thanks for any input there
Eric
========
running: matplotlib version 0.98.3 Python 2.5.1 (r251:54863, Aug 1 2008,
00:35:20) via IPython 0.9.1
Eric Emsellem wrote:
> Hi,
>
> I am trying to run a relatively large code, which includes some calls to and
> import from pylab/matplotlib, on a remote machine: the part of the code I am
> running is NOT performing any plot so there is no direct access to a display.
> Unfortunately it still crashes with something like:
>
> ---> 40 cursors.MOVE : gdk.Cursor(gdk.FLEUR),
> 41 cursors.HAND : gdk.Cursor(gdk.HAND2),
> 42 cursors.POINTER : gdk.Cursor(gdk.LEFT_PTR),
>
> RuntimeError: could not create GdkCursor object
>
> when it tries to reach the display when importing pylab I guess.
>
> I am now doing this from my laptop from a non-fixed IP and there is no easy way
> for me to forward the display (loging e.g. with ssh -X), or to just isolate the
> pylab part of the code (lots of files, lots of lines, etc).
>
> I am desperately trying to run this long calculation on that remote machine (and
> do it while my laptop is off, using "screen") because I need a lot of memory and
> CPU.... How can I overpass this easily (just allowing for the code not to crash
> with that initialisation and go on with the rest) ???
>
> thanks for any input there
>
> Eric
> 
Eric: That looks like the error you get from pygtk when there's no X11 
running. Can you just use a non-gui backend, like plain Agg? See 
http://matplotlib.sourceforge.net/faq/installing_faq.html#backends for 
how to change the default backend.
-Jeff
> ========
> running: matplotlib version 0.98.3 Python 2.5.1 (r251:54863, Aug 1 2008,
> 00:35:20) via IPython 0.9.1
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Eric Emsellem wrote:
> Hi,
> 
> I am trying to run a relatively large code, which includes some calls to and
> import from pylab/matplotlib, on a remote machine: the part of the code I am
> running is NOT performing any plot so there is no direct access to a display.
> Unfortunately it still crashes with something like:
> 
> ---> 40 cursors.MOVE : gdk.Cursor(gdk.FLEUR),
> 41 cursors.HAND : gdk.Cursor(gdk.HAND2),
> 42 cursors.POINTER : gdk.Cursor(gdk.LEFT_PTR),
> 
> RuntimeError: could not create GdkCursor object
> 
> when it tries to reach the display when importing pylab I guess.
> 
> I am now doing this from my laptop from a non-fixed IP and there is no easy way
> for me to forward the display (loging e.g. with ssh -X), or to just isolate the
> pylab part of the code (lots of files, lots of lines, etc).
> 
> I am desperately trying to run this long calculation on that remote machine (and
> do it while my laptop is off, using "screen") because I need a lot of memory and
> CPU.... How can I overpass this easily (just allowing for the code not to crash
> with that initialisation and go on with the rest) ???
Eric,
You need to set a non-interactive backend, typically agg. The method 
depends on exactly what you are doing and what your constraints are. 
The easiest may be to put a matplotlibrc file in the directory from 
which you are starting your ipython session, or running your script. 
All it needs to contain is the single line:
backend : Agg
Alternatively, any script can start with
import matplotlib
matplotlib.use('agg')
This has to come before pylab is imported.
Eric
> 
> thanks for any input there
> 
> Eric
> ========
> running: matplotlib version 0.98.3 Python 2.5.1 (r251:54863, Aug 1 2008,
> 00:35:20) via IPython 0.9.1
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /