Hi,
I was using matplotlib at the end of last week to build some graphs for
a presentation.
I upgraded my snapshot over the weekend, and now I'm getting a crashes.
E.g. the xkcd example graph [1] worked fine on Thursday, but now:
---8<---
$ python2.7 xkcd.py
Traceback (most recent call last):
File "xkcd.py", line 1, in <module>
from matplotlib import pyplot as plt
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 109,
in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File
"/usr/local/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line
32, in pylab_setup
globals(),locals(),[backend_name],0)
File
"/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
line 14, in <module>
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
FigureCanvasGTK,\
File
"/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
line 36, in <module>
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
File
"/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py",
line 33, in <module>
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
--->8---
matplotlib hasn't changed, so I guess something GTKish has changed.
This only seems to affect the gdk backend. For example, before importing
pyplot, you can add:
---8<---
import matplotlib
matplotlib.use(some-different-backend)
--->8---
And this will work. List of backends at [2].
I'm currently working around the crash using the "agg" backend to build
my graphs.
[1] http://matplotlib.org/xkcd/examples/showcase/xkcd.html
[2] http://matplotlib.org/faq/usage_faq.html#what-is-a-backend
--
Best Regards
Edd Barrett
http://www.theunixzoo.co.uk