It looks like you're using the gtk backend but you're running on a remote terminal without an X11 connection. That's what "could not open display" probably means. Are you logged in remotely by any chance? Does 'python -c "import gtk" ' work?
If you want to run headless, you can use the "Agg" backend. See here: http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend Mike Mathes, Gary C wrote: > > Installation question: > > The *import pylab* command reports an error. See bold below for > details. What installation step(s) am I missing? > > Thanks! > > *# uname -a* > > Linux SESB01-RE01 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 > x86_64 x86_64 x86_64 GNU/Linux > > #!/usr/bin/python > > # File: *mp_versions.py* > > import matplotlib > > import numpy > > import matplotlib as mpl > > print "matplotlib version = " + matplotlib.__version__ > > print "matplotlib file = " + matplotlib.__file__ > > print "numpy version = " + numpy.__version__ > > print "mpl.get_configdir = " + mpl.get_configdir() > > *import pylab* > > *# mp_versions.py* > > matplotlib version = 0.99.1.1 > > matplotlib file = > /usr/lib64/python2.4/site-packages/matplotlib/__init__.pyc > > numpy version = 1.2.1 > > mpl.get_configdir = /root/.matplotlib > > *Traceback (most recent call last):* > > * File "./mp_versions.py", line 12, in ?* > > * import pylab* > > * File "/usr/lib64/python2.4/site-packages/pylab.py", line 1, in ?* > > * from matplotlib.pylab import ** > > * File "/usr/lib64/python2.4/site-packages/matplotlib/pylab.py", line > 247, in ?* > > * from matplotlib.pyplot import ** > > * File "/usr/lib64/python2.4/site-packages/matplotlib/pyplot.py", line > 78, in ?* > > * new_figure_manager, draw_if_interactive, show = pylab_setup()* > > * File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/__init__.py", > line 25, in pylab_setup* > > * globals(),locals(),[backend_name])* > > * File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", > line 10, in ?* > > * from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, > FigureCanvasGTK,\* > > * File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtk.py", > line 8, in ?* > > * import gtk; gdk = gtk.gdk* > > * File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", > line 76, in ?* > > * _init()* > > * File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", > line 64, in _init* > > * _gtk.init_check()* > > *RuntimeError: could not open display* > > # *ipython* > > Python 2.4.3 (#1, May 24 2008, 13:57:05) > > Type "copyright", "credits" or "license" for more information. > > IPython 0.8.4 -- An enhanced Interactive Python. > > ? -> Introduction and overview of IPython's features. > > %quickref -> Quick reference. > > help -> Python's own help system. > > object? -> Details about 'object'. ?object also works, ?? prints more. > > *Installation steps:* > > # rpm -ivh refblas3-3.0-11.2.x86_64.rpm lapack3-3.0-19.2.x86_64.rpm > > # rpm –ivh python-dateutil-1.2-1.el5.noarch.rpm > pytz-2006p-1.el5.noarch.rpm > > # rpm -ivh python-setuptools-0.6c5-2.el5.noarch.rpm > > # rpm -ivh python-nose-0.10.4-1.el5.noarch.rpm > > # rpm -ivh atlas-3.8.3-1.el5.x86_64.rpm > > # rpm -ivh numpy-1.2.1-2.el5.x86_64.rpm > > # rpm -ivh python-matplotlib-0.99.1.2-1.el5.x86_64.rpm > > # rpm -ivh ipython-0.8.4-1.el5.noarch.rpm > > *Location of RPMs:* > > http://download.opensuse.org/repositories/home:/ashigabou/CentOS_5/x86_64/ > > http://www.rpmfind.net/linux/rpm2html/search.php?query=python-dateutil > > http://www.rpmfind.net/linux/RPM/epel/5/ppc/pytz-2006p-1.el5.noarch.html > > http://fr2.rpmfind.net/linux/RPM/epel/testing/5/ppc/python-nose-0.10.4-1.el5.noarch.html > > http://rpm.pbone.net/index.php3/stat/4/idpl/12391980/com/atlas-3.8.3-1.el5.x86_64.rpm.html > > http://www.rpmfind.net/linux/rpm2html/search.php?query=numpy > > http://www.rpmfind.net/linux/rpm2html/search.php?query=python-matplotlib > > http://rpm.pbone.net/index.php3/stat/4/idpl/9548551/com/ipython-0.8.4-1.el5.noarch.rpm.html > > **/Gary/** > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users