繁体   English   中英

Windows 上的“没有名为 scipy 的模块”

[英]“No module named scipy” on Windows

在 sklearn\\base.py 中,我有from scipy import sparse的语句。 我收到此错误"no module named scipy"

我尝试使用pip install scipy进行pip install scipy ,但出现了很多错误:

libraries mkl_rt not found
openblas not found
lapack not found
no lapacl/blas resources found

等等。

我应该在 Windows 上做什么?

几天后我找到了这个解决方案。

首先你想安装哪个python版本?

如果你想要 Python 2.7 版本:

第1步:

scipy-0.19.0-cp27-cp27m-win32.whl

scipy-0.19.0-cp27-cp27m-win_amd64.whl

numpy-1.11.3+mkl-cp27-cp27m-win32.whl

numpy-1.11.3+mkl-cp27-cp27m-win_amd64.whl

如果你想要 Python 3.4 版本:

scipy-0.19.0-cp34-cp34m-win32.whl

scipy-0.19.0-cp34-cp34m-win_amd64.whl

numpy-1.11.3+mkl-cp34-cp34m-win32.whl

numpy-1.11.3+mkl-cp34-cp34m-win_amd64.whl

如果你想要 Python 3.5 版本:

scipy-0.19.0-cp35-cp35m-win32.whl

scipy-0.19.0-cp35-cp35m-win_amd64.whl

numpy-1.11.3+mkl-cp35-cp35m-win32.whl

numpy-1.11.3+mkl-cp35-cp35m-win_amd64.whl

如果你想要 Python 3.6 版本:

scipy-0.19.0-cp36-cp36m-win32.whl

scipy-0.19.0-cp36-cp36m-win_amd64.whl

numpy-1.11.3+mkl-cp36-cp36m-win32.whl

numpy-1.11.3+mkl-cp36-cp36m-win_amd64.whl

链接:点击

下载完成后,转到您的目录。

例如我的目录:

cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>
pip install [where/is/your/downloaded/scipy_whl.]

安装后

第2步:

麻木+MKL

再次来自基于 python 版本的同一网站:

之后在 Script 文件夹中再次使用相同的东西

cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>

pip3 install [where/is/your/downloaded/numpy_whl.]

并在 python 文件夹中测试它。

Python35>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy

从以下链接下载 scipy 轮文件

https://pypi.python.org/pypi/scipy

然后使用下载的文件执行 pip install

pip install <wheel-file>

如果需要,提供sudo权限

我在 ubuntu 下安装 Scipy 时遇到同样的问题。 我不得不使用命令:

$ sudo apt-get install libatlas-base-dev gfortran
$ sudo pip install scipy

在 CentOS 上

$ yum install lapack-devel
$ sudo pip install scipy

numpy应该在安装scipy之前安装。 当我只使用numpy运行时,我遇到了这个问题。 首先安装numpy ,然后安装scipy 它对我有用。

pip install numpy

pip install scipy

它将显示这样的消息。

已经满足要求:numpy>=1.8.2 in(来自scipy)

希望这会有所帮助。 :)

我从未成功 pip 安装 scipy,相反,我发现安装所有基本依赖项更容易。 在此处查看您的操作系统

我从来没有在 Windows 上尝试过这个,但是 linux 安装一直对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM