简体   繁体   中英

“No module named scipy” on Windows

In sklearn\\base.py, I have the statement from scipy import sparse . I am getting this error "no module named scipy" .

I tried to install using pip install scipy , but I get so many errors:

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

etc.

What should I do on Windows ?

I found this solution after days.

Firstly which python version you want to install?

If you want for Python 2.7 version:

STEP 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

If you want for Python 3.4 version:

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:

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:

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:

Numpy+MKL

From same web site based on python version again:

After that use same thing again in Script folder

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

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

And test it in python folder.

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

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

Then do pip install with the Downloaded file

pip install <wheel-file>

if required , provide sudo permission

I face same problem when install Scipy under ubuntu. I had to use command:

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

on CentOS

$ yum install lapack-devel
$ sudo pip install scipy

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.

pip install numpy

pip install scipy

It will display a message like this.

Requirement already satisfied: numpy>=1.8.2 in (from 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. Check here for your OS

I've never tried this on windows, but the linux installs have always worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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