可以使用pip安装NumPy。pip install numpy
SciPy是否有类似的可能性?(这样做pip install scipy
是行不通的。)
更新
现在可以安装 SciPy 包了pip
!
先决条件:
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
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.
在 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
要在 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
我尝试了以上所有方法,但对我没有任何帮助。这解决了我所有的问题:
pip install -U numpy
pip install -U scipy
请注意,请求升级包的-U
选项。没有它,如果软件包已经安装,将通知您并退出而不做任何事情。pip install
pip
在 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
.
如果我首先安装 BLAS、LAPACK 和 GCC Fortran 作为系统包(我使用的是Arch Linux),我可以安装 SciPy:
pip install scipy
对于 Arch Linux 用户:
pip install --user scipy
先决条件是要安装以下 Arch 软件包:
gcc-fortran
blas
lapack
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
答案是肯定的,有。
首先,您可以轻松安装 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 :)
这里告诉你更多关于最后一步的信息。
这是类似问题的类似答案。
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
就我而言,直到我还安装了以下软件包才起作用: libatlas-base-dev, gfortran
sudo apt-get install libatlas-base-dev gfortran
然后运行 pip install scipy
除了所有这些答案之外,如果您在 64 位机器上安装 32 位的 python,则无论您的机器如何,您都必须下载 32 位的 scipy。 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 在上面的网址你可以下载包,命令是:pip install
对于 gentoo,它位于主存储库中:
emerge --ask scipy
您也可以在带有 python 3.6 的 windows 中使用它python -m pip install scipy