If you wish to contribute to the project, it’s recommended you install the latest development version.
Installing the latest release¶
- Python (>= 2.6 or >= 3.3),
- NumPy (>= 1.6.1),
- SciPy (>= 0.9).
If you already have a working installation of numpy and scipy,
the easiest way to install scikit-learn is using
pip install -U scikit-learn
conda install scikit-learn
If you have not installed NumPy or SciPy yet, you can also install these using conda or pip. When using pip, please ensure that binary wheels are used, and NumPy and SciPy are not recompiled from source, which can happen when using particular configurations of operating system and hardware (such as Linux on a Raspberry Pi). Building numpy and scipy from source can be complex (especially on Windows) and requires careful configuration to ensure that they link against an optimized implementation of linear algebra routines. Instead, use a third-party distribution as described below.
If you must install scikit-learn and its dependencies with pip, you can install
scikit-learn[alldeps]. The most common use case for this is in a
requirements.txt file used as part of an automated build process for a PaaS
application or a Docker image. This option is not intended for manual
installation from the command line.
If you don’t already have a python installation with numpy and scipy, we recommend to install either via your package manager or via a python bundle. These come with numpy, scipy, scikit-learn, matplotlib and many other helpful scientific and data processing libraries.
Available options are:
Canopy and Anaconda for all supported platforms¶
Anaconda offers scikit-learn as part of its free distribution.
To upgrade or uninstall scikit-learn installed with Anaconda
conda you should not use the pip command. Instead:
conda update scikit-learn
conda remove scikit-learn
pip install -U scikit-learn or uninstalling
pip uninstall scikit-learn is likely fail to properly remove files
installed by the
pip upgrade and uninstall operations only work on packages installed