[SciPy-user] matplotlib: pylab doesn't import (backends problem)

William Hunter willemjagter at gmail.com
Fri Oct 6 02:22:22 CDT 2006


These are installed:
scipy.__version__ = '0.5.1'
numpy.__version__  = '1.0rc1'
matplotlib.__version__ = '0.87.6'

My options in setup.py for matplotlib is set to build Agg and
GTKAgg ( = 1), the others all = 0. If I leave them at 'auto' as per
default, matplotlib doesn't build (?). I use Ubuntu Dapper - AMD64.

Here's what happens if I try to import pylab (in a new terminal):


In [1]: import pylab
---------------------------------------------------------------------------
exceptions.ImportError                               Traceback (most
recent call last)

/home/william/<ipython console>

/usr/lib/python2.4/site-packages/pylab.py
----> 1 from matplotlib.pylab import *

/usr/lib/python2.4/site-packages/matplotlib/pylab.py
    200
    201 from axes import Axes, PolarAxes
--> 202 import backends
    203 from cbook import flatten, is_string_like, exception_to_str, popd, \
    204      silent_list, iterable, enumerate

/usr/lib/python2.4/site-packages/matplotlib/backends/__init__.py
     52 # a hack to keep old versions of ipython working with mpl after bug
     53 # fix #1209354
     54 if 'IPython.Shell' in  sys.modules:
---> 55     new_figure_manager, draw_if_interactive, show = pylab_setup()
     56

/usr/lib/python2.4/site-packages/matplotlib/backends/__init__.py in
pylab_setup()
     21     backend_name = 'backend_'+backend.lower()
     22     backend_mod = __import__('matplotlib.backends.'+backend_name,
---> 23                              globals(),locals(),[backend_name])
     24
     25     # Things we pull in from all backends

/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py
      8 from matplotlib.figure import Figure
      9 from backend_agg import FigureCanvasAgg
---> 10 from backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
     11      show, draw_if_interactive,\
     12      error_msg_gtk, NavigationToolbar, PIXELS_PER_INCH,
backend_version, \

/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py
     19 from matplotlib.backend_bases import RendererBase,
GraphicsContextBase, \
     20      FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
---> 21 from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
     22 from matplotlib.cbook import is_string_like, enumerate
     23 from matplotlib.colors import colorConverter

/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gdk.py
     33     from matplotlib.backends._nc_backend_gdk import
pixbuf_get_pixels_array
     34 else:
---> 35     from matplotlib.backends._ns_backend_gdk import
pixbuf_get_pixels_array
     36
     37

ImportError: No module named _ns_backend_gdk


I had matplotlib 0.87.4 running like a brand new Mercedes-Benz
previously, with older numpy/scipy. Any ideas how to fix this?
--
wh


More information about the SciPy-user mailing list