matplotlib -安装在CentOS -安装。py构建失败

时间:2020-11-28 23:38:54

trying to install matplotlib (1.1.0 with python 2.7.3 on CentOS)

尝试在CentOS上安装matplotlib(1.1.0和python 2.7.3)

python setup.py build

python的设置。py构建

looks good until:

看起来不错,直到:

running build_ext
building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.7/src/ft2font.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c src/mplutils.cpp -o build/temp.linux-x86_64-2.7/src/mplutils.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c CXX/cxx_extensions.cxx -o build/temp.linux-x86_64-2.7/CXX/cxx_extensions.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c CXX/IndirectPythonInterface.cxx -o build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c CXX/cxxsupport.cxx -o build/temp.linux-x86_64-2.7/CXX/cxxsupport.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/numpy-1.5.1-release/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/include/python2.7 -c CXX/cxxextensions.c -o build/temp.linux-x86_64-2.7/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/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib64 -L/usr/lib64 -L/mnt/storage/laviniag/Tools/Qiime/qiime_software/python-2.7.3-release/lib -lfreetype -lz -lstdc++ -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
**/usr/bin/ld: /usr/local/lib/libpython2.7.a(parsetok.o): relocation R_X86_64_32 against `.rodata.str1.1' 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**

So I'm guessing I need to either edit the config file maybe to allow sharing? Any help appreciated, thanks.

我猜我需要编辑配置文件或者允许共享?任何帮助的感激,谢谢。

2 个解决方案

#1


3  

matplotlib is one of the packages that can be really hard to install, there are plenty of others (ahem... lxml, pyside/pyqt4, etc).

matplotlib是一个很难安装的包,还有很多其他的包。lxml pyside / pyqt4等等)。

Save yourself some trouble and checkout one of the pre-builts. Anaconda from continuum or canopy from enthought are good on cetos and will save you a log of headaches (free installs).

省去一些麻烦,检查一个预构建。来自连续体或树冠的水蟒在cetos上很好,可以为你节省一份头痛的记录(免费安装)。

#2


0  

Just use pip and virtualenv, it should work fine (CentOS-6.5, x86_64, python-2.6) Installing Matplotlib on CentOS 6.5

只需使用pip和virtualenv,它就可以正常工作(CentOS-6.5, x86_64, python-2.6),在CentOS 6.5上安装Matplotlib。

#1


3  

matplotlib is one of the packages that can be really hard to install, there are plenty of others (ahem... lxml, pyside/pyqt4, etc).

matplotlib是一个很难安装的包,还有很多其他的包。lxml pyside / pyqt4等等)。

Save yourself some trouble and checkout one of the pre-builts. Anaconda from continuum or canopy from enthought are good on cetos and will save you a log of headaches (free installs).

省去一些麻烦,检查一个预构建。来自连续体或树冠的水蟒在cetos上很好,可以为你节省一份头痛的记录(免费安装)。

#2


0  

Just use pip and virtualenv, it should work fine (CentOS-6.5, x86_64, python-2.6) Installing Matplotlib on CentOS 6.5

只需使用pip和virtualenv,它就可以正常工作(CentOS-6.5, x86_64, python-2.6),在CentOS 6.5上安装Matplotlib。