5

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?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958

5 Answers5

8

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
Community
  • 1
  • 1
Beyhan Gul
  • 1,191
  • 1
  • 15
  • 25
6

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

shahin
  • 3,515
  • 1
  • 17
  • 17
2

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
Saurabh Pandey
  • 519
  • 2
  • 15
  • 1
    It's bad practice to do `sudo pip install scipy` -- running PyPI packages as root is dangerous and installing Python stuff into the main site-packages dir is very bad practice (it edits your OS). Consider using virtualenv, using conda+conda envs, or installing to the home directory or similar. – Mike Graham Apr 06 '17 at 05:08
  • @Mike Graham completely agree, but please check whom are u answering to. check his ques. it has a line "I tried to install using "pip install scipy". But when I do that, I get so many errors". i thought this would be easy thing for him for now. – Saurabh Pandey Apr 06 '17 at 05:10
1

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. :)

Choxmi
  • 1,584
  • 4
  • 29
  • 47
0

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.

mwkrimson
  • 115
  • 1
  • 9