简体   繁体   English

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

[英]“No module named scipy” on Windows

In sklearn\\base.py, I have the statement from scipy import sparse .在 sklearn\\base.py 中,我有from scipy import sparse的语句。 I am getting this error "no module named scipy" .我收到此错误"no module named scipy"

I tried to install using pip install scipy , but I get so many errors:我尝试使用pip install scipy进行pip install scipy ,但出现了很多错误:

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

etc.等等。

What should I do on Windows ?我应该在 Windows 上做什么?

I found this solution after days.几天后我找到了这个解决方案。

Firstly which python version you want to install?首先你想安装哪个python版本?

If you want for Python 2.7 version:如果你想要 Python 2.7 版本:

STEP 1:第1步:

scipy‑0.19.0‑cp27‑cp27m‑win32.whl scipy-0.19.0-cp27-cp27m-win32.whl

scipy‑0.19.0‑cp27‑cp27m‑win_amd64.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-win32.whl

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

If you want for Python 3.4 version:如果你想要 Python 3.4 版本:

scipy‑0.19.0‑cp34‑cp34m‑win32.whl scipy-0.19.0-cp34-cp34m-win32.whl

scipy‑0.19.0‑cp34‑cp34m‑win_amd64.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-win32.whl

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

If you want for Python 3.5 version:如果你想要 Python 3.5 版本:

scipy‑0.19.0‑cp35‑cp35m‑win32.whl scipy-0.19.0-cp35-cp35m-win32.whl

scipy‑0.19.0‑cp35‑cp35m‑win_amd64.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-win32.whl

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

If you want for Python 3.6 version:如果你想要 Python 3.6 版本:

scipy‑0.19.0‑cp36‑cp36m‑win32.whl scipy-0.19.0-cp36-cp36m-win32.whl

scipy‑0.19.0‑cp36‑cp36m‑win_amd64.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-win32.whl

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

Link: click链接:点击

Once the download finished, go to your directory.下载完成后,转到您的目录。

For example my directory:例如我的目录:

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

After that installation安装后

STEP 2:第2步:

Numpy+MKL麻木+MKL

From same web site based on python version again:再次来自基于 python 版本的同一网站:

After that use same thing again in Script folder之后在 Script 文件夹中再次使用相同的东西

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

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

And test it in python folder.并在 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

Download the scipy wheel file from the following link从以下链接下载 scipy 轮文件

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

Then do pip install with the Downloaded file然后使用下载的文件执行 pip install

pip install <wheel-file>

if required , provide sudo permission如果需要,提供sudo权限

I face same problem when install Scipy under ubuntu.我在 ubuntu 下安装 Scipy 时遇到同样的问题。 I had to use command:我不得不使用命令:

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

on CentOS在 CentOS 上

$ yum install lapack-devel
$ sudo pip install scipy

numpy should be installed before installing scipy . numpy应该在安装scipy之前安装。 I face this issue when I was running only with numpy .当我只使用numpy运行时,我遇到了这个问题。 First install numpy and then install scipy .首先安装numpy ,然后安装scipy It worked for me.它对我有用。

pip install numpy

pip install scipy

It will display a message like this.它将显示这样的消息。

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

Hope this would be helpful.希望这会有所帮助。 :) :)

I have never successfully pip'd a scipy install, instead I have found it easier to install all the base dependencies.我从未成功 pip 安装 scipy,相反,我发现安装所有基本依赖项更容易。 Check here for your OS在此处查看您的操作系统

I've never tried this on windows, but the linux installs have always worked for me.我从来没有在 Windows 上尝试过这个,但是 linux 安装一直对我有用。

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

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