使用pip安装SciPy和NumPy [英] Installing SciPy and NumPy using pip
问题描述
我正在尝试在要分发的程序包中创建所需的库.它需要 SciPy 和 NumPy 库. 在开发过程中,我同时使用
I'm trying to create required libraries in a package I'm distributing. It requires both the SciPy and NumPy libraries. While developing, I installed both using
apt-get install scipy
安装了SciPy 0.9.0和NumPy 1.5.1,并且运行良好.
which installed SciPy 0.9.0 and NumPy 1.5.1, and it worked fine.
我想使用pip install
做同样的事情-为了能够在我自己的程序包的setup.py中指定依赖项.
I would like to do the same using pip install
- in order to be able to specify dependencies in a setup.py of my own package.
问题是,当我尝试时:
pip install 'numpy==1.5.1'
它工作正常.
但是然后
pip install 'scipy==0.9.0'
惨败,
raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
我如何使它工作?
推荐答案
我假设我的回答是Linux经验;我发现要使pip install scipy
顺利进行,有三个先决条件.
I am assuming Linux experience in my answer; I found that there are three prerequisites to getting pip install scipy
to proceed nicely.
转到此处:安装SciPY
按照说明下载,构建和导出 BLAS 的env变量,然后LAPACK .注意不要盲目剪切'n'粘贴shell命令-您需要根据您的体系结构等选择几行,并且您需要修复/添加错误地假定为的正确目录.好吧.
Follow the instructions to download, build and export the env variable for BLAS and then LAPACK. Be careful to not just blindly cut'n'paste the shell commands - there will be a few lines you need to select depending on your architecture, etc., and you'll need to fix/add the correct directories that it incorrectly assumes as well.
您可能需要做的第三件事是 yum install numpy-f2py 或等效安装程序.
The third thing you may need is to yum install numpy-f2py or the equivalent.
是的,最后,您可能需要安装gcc-gfortran ,因为上面的库是 Fortran 源.
Oh, yes and lastly, you may need to yum install gcc-gfortran as the libraries above are Fortran source.
这篇关于使用pip安装SciPy和NumPy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!