Install SciPy and Scikit-learn

SciPy is an ecosystem of Python libraries for mathematics, science, and engineering. In particular, these are some of the core packages:

  • NumPy
  • Matplotlib
  • Pandas

Scikit-learn is a free software machine learning library for the Python programming language. It features various machine learning algorithm for classification, regression, clustering and more.


After reading this post, you will know:

  • Install the SciPy Stack
  • Install scikit-learn

Let’s get started.


Install the SciPy Stack

Option 1: Install Anaconda on Mac OS X

The easiest way is to download the Anaconda distribution which includes all the key packages.

Option 2: Installing via pip


python -m pip install --user numpy scipy matplotlib pandas

Confirm installation by printing the versions of the installed libraries


# scipy
import scipy
print( ' scipy: %s ' % scipy.__version__)
# numpy
import numpy
print( ' numpy: %s ' % numpy.__version__)
# matplotlib
import matplotlib
print( ' matplotlib: %s ' % matplotlib.__version__)
# pandas
import pandas
print( ' pandas: %s ' % pandas.__version__)

Output on my machine:


 scipy: 0.18.1 
 numpy: 1.15.4 
 matplotlib: 2.0.0 
 pandas: 0.19.2 

Install scikit-learn

Scikit-learn requires:

Python (>= 2.7 or >= 3.4),
NumPy (>= 1.8.2),
SciPy (>= 0.13.3).

Option 1: Install Anaconda on Mac OS X

The easiest way is to download the Anaconda distribution which includes all the key packages.

Option 2: Installing via pip


pip install -U scikit-learn

Confirm installation


import sklearn
print( ' sklearn: %s ' % sklearn.__version__)

Output on my machine:


sklearn: 0.18.1 

Leave a Reply

Your email address will not be published. Required fields are marked *