209

可以使用pip安装NumPypip install numpy

SciPy是否有类似的可能性?(这样做pip install scipy是行不通的。)


更新

现在可以安装 SciPy 包了pip

4

15 回答 15

217

先决条件:

sudo apt-get install build-essential gfortran libatlas-base-dev python-pip python-dev
sudo pip install --upgrade pip

实际套餐:

sudo pip install numpy
sudo pip install scipy

可选包:

sudo pip install matplotlib   OR  sudo apt-get install python-matplotlib
sudo pip install -U scikit-learn
sudo pip install pandas

源代码

于 2013-03-12T07:45:21.120 回答
107

An attempt to easy_install indicates a problem with their listing in the Python Package Index, which pip searches.

easy_install scipy
Searching for scipy
Reading http://pypi.python.org/simple/scipy/
Reading http://www.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531
Reading http://new.scipy.org/Wiki/Download

All is not lost, however; pip can install from Subversion (SVN), Git, Mercurial, and Bazaar repositories. SciPy uses SVN:

pip install svn+http://svn.scipy.org/svn/scipy/trunk/#egg=scipy

Update (12-2012):

pip install git+https://github.com/scipy/scipy.git

Since NumPy is a dependency, it should be installed as well.

于 2010-02-06T17:48:20.537 回答
33

在 Ubuntu 10.04 (Lucid) 中,我可以pip install scipy在安装一些依赖项后成功(在 virtualenv 中),特别是:

$ sudo apt-get install libamd2.2.0 libblas3gf libc6 libgcc1 libgfortran3 liblapack3gf libumfpack5.4.0 libstdc++6 build-essential gfortran libatlas-sse2-dev python-all-dev
于 2010-10-05T16:05:34.193 回答
22

要在 Windows 上安装 scipy,请按照以下说明操作:-

第 1 步:按此链接http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy下载 scipy .whl 文件(例如 scipy-0.17.0-cp34-none-win_amd64.whl)。

步骤 2:从命令提示符 (cd folder-name) 转到该下载文件所在的目录。

第 3 步:运行以下命令:

pip install scipy-0.17.0-cp27-none-win_amd64.whl
于 2015-12-11T09:32:22.093 回答
19

我尝试了以上所有方法,但对我没有任何帮助。这解决了我所有的问题:

pip install -U numpy

pip install -U scipy

请注意,请求升级包的-U选项。没有它,如果软件包已经安装,将通知您并退出而不做任何事情。pip installpip

于 2014-03-19T00:17:56.693 回答
13

在 Fedora 上,这有效:

sudo yum install -y python-pip
sudo yum install -y lapack lapack-devel blas blas-devel 
sudo yum install -y blas-static lapack-static
sudo pip install numpy
sudo pip install scipy

如果您public key在下载时遇到任何错误,请将--nogpgcheck其作为参数添加到yum中,例如: yum --nogpgcheck install blas-devel

从 Fedora 23开始,dnf使用yum.

于 2015-01-23T18:26:22.303 回答
13

如果我首先安装 BLAS、LAPACK 和 GCC Fortran 作为系统包(我使用的是Arch Linux),我可以安装 SciPy:

pip install scipy
于 2010-09-02T08:29:46.713 回答
7

对于 Arch Linux 用户:

pip install --user scipy先决条件是要安装以下 Arch 软件包:

  • gcc-fortran
  • blas
  • lapack
于 2014-03-25T11:50:57.990 回答
3

Ubuntu 插件(Ubuntu 10.04 LTS (Lucid Lynx)):

存储库移动了,但是

pip install -e git+http://github.com/scipy/scipy/#egg=scipy

对我来说失败了......通过以下步骤,它终于成功了(作为虚拟环境中的 root,其中python3是 Python 3.2.2 的链接):安装 Ubuntu 依赖项(参见 elaichi),克隆 NumPy 和 SciPy:

git clone git://github.com/scipy/scipy.git scipy

git clone git://github.com/numpy/numpy.git numpy

构建 NumPy(在numpy文件夹内):

python3 setup.py build --fcompiler=gnu95

安装 SciPy(在scipy文件夹中):

python3 setup.py install
于 2011-10-05T22:22:41.470 回答
3

答案是肯定的,有。

首先,您可以轻松安装 numpy 使用命令:

pip install numpy

然后你应该安装mkl,这是Scipy需要的,你可以在这里下载

下载 file_name.whl 后安装它

C:\Users\****\Desktop\a> pip install mkl_service-1.1.2-cp35-cp35m-win32.whl
Processing c:\users\****\desktop\a\mkl_service-1.1.2-cp35-cp35m-win32.whl 
Installing collected packages: mkl-service    
Successfully installed mkl-service-1.1.2

然后在同一个网站你可以下载 scipy-0.18.1-cp35-cp35m-win32.whl

注意:根据你的python版本下载file_name.whl,如果你的python版本是32bit python3.5你应该下载这个,“win32”是你的python版本,不是你的操作系统版本。

然后像这样安装 file_name.whl:

C:\Users\****\Desktop\a>pip install scipy-0.18.1-cp35-cp35m-win32.whl
Processing c:\users\****\desktop\a\scipy-0.18.1-cp35-cp35m-win32.whl
Installing collected packages: scipy
Successfully installed scipy-0.18.1

然后只有一件事要做:注释掉特定的行,否则在输入命令“import scipy”时会出现错误消息。

所以注释掉这一行

from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl

在这个文件中:your_own_path\lib\site-packages\scipy__init__.py

然后你可以使用 SciPy :)

这里告诉你更多关于最后一步的信息。

是类似问题的类似答案。

于 2016-10-27T07:25:37.033 回答
3
  1. 安装 python-3.4.4
  2. scipy-0.15.1-win32-superpack-python3.4
  3. 应用以下推荐文档
py -m pip install --upgrade pip
py -m pip install numpy
py -m pip install matplotlib
py -m pip install scipy
py -m pip install scikit-learn
于 2016-06-17T14:46:32.747 回答
3

就我而言,直到我还安装了以下软件包才起作用: libatlas-base-dev, gfortran

 sudo apt-get install libatlas-base-dev gfortran

然后运行 ​​pip install scipy

于 2015-09-04T10:02:29.320 回答
1

除了所有这些答案之外,如果您在 64 位机器上安装 32 位的 python,则无论您的机器如何,您都必须下载 32 位的 scipy。 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 在上面的网址你可以下载包,命令是:pip install

于 2016-09-27T06:57:48.553 回答
0

对于 gentoo,它位于主存储库中: emerge --ask scipy

于 2016-04-13T05:02:30.730 回答
0

您也可以在带有 python 3.6 的 windows 中使用它python -m pip install scipy

于 2018-04-25T22:13:00.937 回答