SciPy 无法通过 pip 安装
SciPy fails to install via pip
我尝试在 SLURM 环境中使用 pip 安装 SciPy。 NumPy 和其他一些 python 模块已经安装并且工作正常。
然而,当我 运行:
pip2.7 install --user --use-wheel scipy
或
pip2.7 install --user scipy
我总是收到一大堆以以下结尾的文字:
error: Command "/sw/compiler/gcc-4.9.3/bin/gfortran -Wall -g -shared
-Wall -g -shared -shared build/temp.linux-x86_64-2.7/scipy/integrate/_odepackmodule.o
-L/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/lib -L/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/lib -Lbuild/temp.linux-x86_64-2.7 -lodepack -lmach -llapack -lblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/scipy/integrate/_odepack.so" failed with
exit status 1
Command "/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/bin/python2.7 -c
"import setuptools,
tokenize;file='/work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-build-fORQns/scipy/setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
/work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-7oTcK5-record/install-record.txt
--single-version-externally-managed --compile --user --prefix=" failed with error code 1 in
/work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-build-fORQns/scipy
不幸的是,我不知道这应该告诉我什么...有什么想法吗?
您需要有 C、C++ 和 Fortran 编译器和 BLAS/LAPACK 库才能编译 scipy。最简单的选择可能是 gcc+gfortran+prebuilt atlas,它应该可以正常工作。对于性能,尤其是线性代数,您可能需要考虑使用英特尔 MKL 或 OpenBLAS。
我建议通过科学包安装 scipy,而不是使用 gfortran 包:
Python XY
Anaconda (supports virtual env)
我尝试在 SLURM 环境中使用 pip 安装 SciPy。 NumPy 和其他一些 python 模块已经安装并且工作正常。
然而,当我 运行:
pip2.7 install --user --use-wheel scipy
或
pip2.7 install --user scipy
我总是收到一大堆以以下结尾的文字:
error: Command "/sw/compiler/gcc-4.9.3/bin/gfortran -Wall -g -shared -Wall -g -shared -shared build/temp.linux-x86_64-2.7/scipy/integrate/_odepackmodule.o -L/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/lib -L/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/lib -Lbuild/temp.linux-x86_64-2.7 -lodepack -lmach -llapack -lblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/scipy/integrate/_odepack.so" failed with exit status 1
Command "/sw/env/gcc-4.9.3_openmpi-1.8.8/pkgsrc/2015Q4/bin/python2.7 -c "import setuptools, tokenize;file='/work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-build-fORQns/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-7oTcK5-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /work/tmp/node001.admin.2016-02-09-015538.intx033.31602/pip-build-fORQns/scipy
不幸的是,我不知道这应该告诉我什么...有什么想法吗?
您需要有 C、C++ 和 Fortran 编译器和 BLAS/LAPACK 库才能编译 scipy。最简单的选择可能是 gcc+gfortran+prebuilt atlas,它应该可以正常工作。对于性能,尤其是线性代数,您可能需要考虑使用英特尔 MKL 或 OpenBLAS。
我建议通过科学包安装 scipy,而不是使用 gfortran 包: Python XY Anaconda (supports virtual env)