Python Windows 上的“没有名为 scipy 的模块”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43246003/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"No module named scipy" on Windows
提问by Geethu Alphonsa Jose
In sklearn\base.py, I have the statement from scipy import sparse
.
I am getting this error "no module named scipy"
.
在 sklearn\base.py 中,我有语句from scipy import sparse
。我收到此错误"no module named scipy"
。
I tried to install using pip install scipy
, but I get so many errors:
我尝试使用 安装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 上做什么?
回答by Beyhan Gül
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?win_amd64.whl
numpy?1.11.3+mkl?cp27?cp27m?win32.whl
numpy?1.11.3+mkl?cp27?cp27m?win_amd64.whl
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
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?win_amd64.whl
numpy?1.11.3+mkl?cp34?cp34m?win32.whl
numpy?1.11.3+mkl?cp34?cp34m?win_amd64.whl
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
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?win_amd64.whl
numpy?1.11.3+mkl?cp35?cp35m?win32.whl
numpy?1.11.3+mkl?cp35?cp35m?win_amd64.whl
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
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?win_amd64.whl
numpy?1.11.3+mkl?cp36?cp36m?win32.whl
numpy?1.11.3+mkl?cp36?cp36m?win_amd64.whl
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
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
回答by shahin
Download the scipy wheel file from the following link
从以下链接下载 scipy wheel 文件
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权限
回答by Saurabh Pandey
I face same problem when install Scipy under ubuntu. I had to use command:
我在 ubuntu 下安装 Scipy 时遇到同样的问题。我不得不使用命令:
$ sudo apt-get install libatlas-base-dev gfortran
$ sudo pip install scipy
on CentOS
在 CentOS 上
$ yum install lapack-devel
$ sudo pip install scipy
回答by Choxmi
numpy
should be installed before installing scipy
. I face this issue when I was running only with numpy
. First install numpy
and then install scipy
. It worked for me.
numpy
安装前应该先安装scipy
。当我只使用numpy
. 先安装numpy
再安装scipy
。它对我有用。
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. :)
希望这会有所帮助。:)
回答by mwkrimson
I have never successfully pip'd a scipy install, instead I have found it easier to install all the base dependencies. Check here for your OS
我从未成功 pip 安装 scipy,相反,我发现安装所有基本依赖项更容易。在此处查看您的操作系统
I've never tried this on windows, but the linux installs have always worked for me.
我从来没有在 Windows 上尝试过这个,但是 linux 安装一直对我有用。