简体   繁体   English

matplotlib-在CentOS上安装-setup.py构建失败

[英]matplotlib - installing on CentOS - setup.py build fails

trying to install matplotlib (1.1.0 with python 2.7.3 on CentOS) 尝试安装matplotlib(在CentOS上为1.2.7和python 2.7.3)

python setup.py build python setup.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. 任何帮助表示赞赏,谢谢。

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). 连续体的Anaconda或有思想的树冠对cetos都很好,并且可以为您节省很多头痛(免费安装)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM