Error Installing scikit-learn

Are you the root user? Do you have admin privileges?

One way you be to do:

$ sudo pip install scikit-learn

You will need to type your password and then it should work.


One straight way to install scikit learn from scratch is following the below steps:

1) install pip from https://pypi.python.org/pypi/pip/ or upgrade in your cmd using

python -m pip install -U pip setuptools

2) run

pip install wheel

3) download the numpy, scipy & scikit learn files from http://www.lfd.uci.edu/~gohlke/pythonlibs/. (numpy+MKL & scipy modules. Check for your python version and 32 bit or 64 bit CPU.

4) run these in your command prompt:

pip install numpy-1.12.1+mkl-cp36-cp36m-win_amd64.whl

pip install scipy-0.19.0-cp36-cp36m-win_amd64.whl

pip install scikit_learn-0.18.1-cp36-cp36m-win_amd64.whl

You are ready to play with Scikit learn

5) run this in your python shell:

import numpy, scipy, sklearn

Note: I saw several articles on building from source on windows. You don't have to build from source for binary wheel files that you installed from the above link on your windows.