Hi,
I had the following error message when I tried to install matplotlib-0.98.5.2.tar.gz from source.
The build and install process seemed to proceed without errors, but when I tried
“import pylab”, I got the following traceback:
File /usr/local/lib/python2.5/site-packages/pylab.py, line 1, in
from matplotlib.pylab import *
File /usr/local/lib/python2.5/site-packages/matplotlib/pylab.py, line 249, in
from matplotlib.pyplot import *
File /usr/local/lib/python2.5/site-packages/matplotlib/pyplot.py, line 75, in <module>
new_figure_manager, draw_if_interactive, show = pylab_setup()
File /usr/local/lib/python2.5/site-packages/matplotlib/backends/init.py, line 23, in pylab_setup
globals(),locals(),[backend_name])
File /usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py, line 10, in <module>
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK, File /usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py, line 21, in <module>
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
File /usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_gdk.py, line 29, in <module>
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
I figured out that this was due to an extra comma in setupext.py.
Edit line 1347 to remove the extra comma, changing this:
module = Extension(
‘matplotlib.backends._backend_gdk’,
[‘src/backend_gdk.c’, ], #<---- HERE IS THE BAD EXTRA COMMA
libraries = ,
include_dirs=numpy_inc_dirs,
)
to this:
module = Extension(
‘matplotlib.backends._backend_gdk’,
[‘src/backend_gdk.c’ ],
libraries = ,
include_dirs=numpy_inc_dirs,
)
Then
python setup.py build
sudo python setup.py install
python -c “import pylab”
works as expected.