Installation von Matplotlib unter CentOS 6.5

Ich versuche, matplotlib-1.4.0 unter CentOS 6.5 mit Python 2.7.8 zu installieren. Ich habe versucht, mit pip und von der Quelle zu installieren. Ich erhielt zunächst die Fehlermeldung, dass ich eine neuere Version von Freetype2 benötige, die ich dann in / usr / local / bin, / usr / local / include und / usr / local / lib installiert habe (Version 2.5.3). Die ältere Version von Freetype2 (2.3.11) befindet sich in / usr / bin, / usr / include / freetype2 / freetype und /usr/lib

Wenn ich jetzt versuche, matplotlib (python setup.py build) zu installieren, scheinen alle Include-Pfade auf die falsche (alte) Version von Freetype2 zu verweisen, und ich kann nicht herausfinden, wie ich die entsprechenden Pfade so ändern kann, dass sie auf die verweisen neuere Version von Freetype2. Die eigentliche Fehlermeldung ist unten und ist ziemlich chaotisch. Ich konnte online nicht viel über seinen Fehler herausfinden, aber ich kann sehen, dass der Freetype2-Pfad falsch ist. Ich schätze, das ist der Grund für das Problem. Irgendwelche Tipps

Funde Tipps zu anderen Threads zum Hinzufügen von / usr / include / freetype symlink, um auf / usr / local / include / freetype2 zu verweisen, aber das hat nicht geholfen.

building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.7/src/ft2font.o
In file included from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,
                 from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from src/file_compat.h:7,
                 from src/ft2font.cpp:7:
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
In file included from src/ft2font.cpp:7:0:
src/file_compat.h:31:0: warning: "npy_fseek" redefined [enabled by default]
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_common.h:86:0: note: this is the location of the previous definition
src/file_compat.h:32:0: warning: "npy_ftell" redefined [enabled by default]
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_common.h:91:0: note: this is the location of the previous definition
src/ft2font.cpp: In member function ‘Py::Object FT2Image::py_write_bitmap(const Py::Tuple&)’:
src/ft2font.cpp:184:15: warning: unused variable ‘offset’ [-Wunused-variable]
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c src/mplutils.cpp -o build/temp.linux-x86_64-2.7/src/mplutils.o
In file included from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/Python.h:8:0,
                 from src/mplutils.h:18,
                 from src/mplutils.cpp:6:
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:162:0: note: this is the location of the previous definition
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/pyconfig.h:1204:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
/usr/include/features.h:164:0: note: this is the location of the previous definition
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxxsupport.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxx_extensions.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/IndirectPythonInterface.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxxextensions.c -o build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o
g++ -pthread -shared build/temp.linux-x86_64-2.7/src/ft2font.o build/temp.linux-x86_64-2.7/src/mplutils.o build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib -L/usr/local/lib64 -L/usr/lib -L/usr/lib64 -L/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib -lfreetype -lstdc++ -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1  

Antworten auf die Frage(4)

Ihre Antwort auf die Frage