gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 12:04:26 26 4
gpt4 key购买 nike

尝试安装 matplotlib(在 CentOS 上使用 python 2.7.3 的 1.1.0)

python setup.py 构建

看起来不错,直到:

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**

所以我猜我需要编辑配置文件以允许共享?感谢任何帮助,谢谢。

最佳答案

matplotlib 是真正难以安装的软件包之一,还有很多其他软件包(咳咳……lxml、pyside/pyqt4 等)。

为自己省去一些麻烦并检查其中一个预建件。 Anaconda来自 continuum 或来自 enthought 的 canopy 在 cetos 上很好,并且会为您省去一大堆麻烦事(免费安装)。

关于python - matplotlib - 在 CentOS 上安装 - setup.py 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20233348/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com