Closed
Description
I am trying to build and install matplotlib on a RHEL 5.8 system:
$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.8 (Tikanga)
Release: 5.8
Codename: Tikanga
I have numpy 1.8.0 installed. I have tried building and installing matplotlib 1.3.1 or 1.3.0. The installation succeeds, but then importing matplotlib.pyplot
returns:
In [2]: import matplotlib.pyplot as plt
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/prod/home/alok/cythontest/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/pyplot.py", line 98, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/prod/home/alok/cythontest/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/__init__.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/prod/home/alok/cythontest/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_agg.py", line 38, in <module>
from matplotlib.backends._backend_agg import RendererAgg as _RendererAgg
ImportError: /prod/home/alok/cythontest/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/_backend_agg.so: undefined symbol: MPL_matplotlib__path_ARRAY_API
The MPL_matplotlib__path_ARRAY_API
symbol is defined in _path.so
file, but is undefined in backends/_backend_agg.so
:
$ nm backends/_backend_agg.so | grep ARRAY_API
U MPL_matplotlib__path_ARRAY_API
000776c0 B MPL_matplotlib_backends__backend_agg_ARRAY_API
00014280 t _GLOBAL__I_MPL_matplotlib_backends__backend_agg_ARRAY_API
I am not sure why _backend_agg.so
is referring to MPL_matplotlib__path_ARRAY_API
. On a more modern system (Linux Mint 13), the output from the above command is:
000000000026b438 B MPL_matplotlib_backends__backend_agg_ARRAY_API
I built matplotlib with the following:
$ python setup.py build
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmp6y4XL0
Now working in /tmp/tmp6y4XL0/distribute-0.6.28
Building a Distribute egg in /prod/home/alok/Downloads/matplotlib-1.3.1
/prod/home/alok/Downloads/matplotlib-1.3.1/distribute-0.6.28-py2.6.egg
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.6.4 (r264:75706, Apr 12 2012, 06:55:25) [GCC
4.1.2 20080704 (Red Hat 4.1.2-46)]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.0]
dateutil: yes [using dateutil version 1.5]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [matplotlib requires pyparsing >= 1.5.6]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 9.10.3]
png: yes [version 1.2.10]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 0.11.1]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: no [PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing, version 73770]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: yes [version 1.5]
ghostscript: yes [version 8.70]
latex: yes [version 3.141592]
pdftops: no
Other information:
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python -V
Python 2.6.4
$ python -c 'import numpy; print numpy.__version__'
1.8.0
Am I doing something wrong?