10000 DOC Reorganize general installation instructions (#15011) · crankycoder/scikit-learn@3046990 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3046990

Browse files
cmarmoogrisel
authored andcommitted
DOC Reorganize general installation instructions (scikit-learn#15011)
1 parent 871b251 commit 3046990

File tree

3 files changed

+114
-154
lines changed

3 files changed

+114
-154
lines changed

doc/developers/advanced_installation.rst

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11

22
.. _advanced-installation:
33

4-
===================================
5-
Advanced installation instructions
6-
===================================
7-
8-
There are different ways to get scikit-learn installed:
9-
10-
* :ref:`Install an official release <install_official_release>`. This
11-
is the best approach for most users. It will provide a stable version
12-
and pre-build packages are available for most platforms.
13-
14-
* Install the version of scikit-learn provided by your
15-
:ref:`operating system or Python distribution <install_by_distribution>`.
16-
This is a quick option for those who have operating systems
17-
that distribute scikit-learn. It might not provide the latest release
18-
version.
19-
20-
* :ref:`Building the package from source
21-
<install_bleeding_edge>`. This is best for users who want the
22-
latest-and-greatest features and aren't afraid of running
23-
brand-new code. This document describes how to build from source.
24-
25-
.. note::
26-
27-
If you wish to contribute to the project, you need to
28-
:ref:`install the latest development version<install_bleeding_edge>`.
4+
==================================================================
5+
Installing the development version of scikit-learn (master branch)
6+
==================================================================
297

308
.. _install_nightly_builds:
319

doc/install.rst

Lines changed: 111 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,46 @@
44
Installing scikit-learn
55
=======================
66

7-
.. note::
7+
There are different ways to install scikit-learn:
8+
9+
* :ref:`Install the latest official release <install_official_release>`. This
10+
is the best approach for most users. It will provide a stable version
11+
and pre-built packages are available for most platforms.
812

9-
If you wish to contribute to the project, it's recommended you
10-
:ref:`install the latest development version<install_bleeding_edge>`.
13+
* Install the version of scikit-learn provided by your
14+
:ref:`operating system or Python distribution <install_by_distribution>`.
15+
This is a quick option for those who have operating systems or Python
16+
distributions that distribute scikit-learn.
17+
It might not provide the latest release version.
18+
19+
* :ref:`Building the package from source
20+
<install_bleeding_edge>`. This is best for users who want the
21+
latest-and-greatest features and aren't afraid of running
22+
brand-new code. This is also needed for users who wish to contribute to the
23+
project.
1124

1225

1326
.. _install_official_release:
1427

1528
Installing the latest release
1629
=============================
1730

18-
Scikit-learn requires:
19-
20-
- Python (>= 3.5)
21-
- NumPy (>= 1.11.0)
22-
- SciPy (>= 0.17.0)
23-
- joblib (>= 0.11)
24-
25-
Scikit-learn plotting capabilities (i.e., functions start with "plot\_"
26-
and classes end with "Display") require Matplotlib (>= 1.5.1). For running the
27-
examples Matplotlib >= 1.5.1 is required. A few examples require
28-
scikit-image >= 0.12.3, a few examples require pandas >= 0.18.0.
29-
30-
.. warning::
31-
32-
Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4.
33-
Scikit-learn now requires Python 3.5 or newer.
34-
3531
If you already have a working installation of numpy and scipy,
36-
the easiest way to install scikit-learn is using ``pip`` ::
32+
the easiest way to install scikit-learn is using ``pip`` or ``conda``.
33+
34+
With ``pip``::
3735

3836
pip install -U scikit-learn
3937

40-
or ``conda``::
38+
Note that in order to avoid potential conflicts with other packages it is
39+
strongly recommended to use a virtual environment, e.g. python3 ``virtualenv``
40+
(see `python3 virtualenv documentation
41+
<https://docs.python.org/3/tutorial/venv.html>`_).
42+
43+
If you choose to use ``conda`` (see the `instructions for downloading conda
44+
<https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html>`_,
45+
and `how to use conda environments
46+
<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_)::
4147

4248
conda install scikit-learn
4349

@@ -46,74 +52,116 @@ conda or pip. When using pip, please ensure that *binary wheels* are used,
4652
and NumPy and SciPy are not recompiled from source, which can happen when using
4753
particular configurations of operating system and hardware (such as Linux on
4854
a Raspberry Pi).
49-
Building numpy and scipy from source can be complex (especially on Windows) and
50-
requires careful configuration to ensure that they link against an optimized
51-
implementation of linear algebra routines.
52-
Instead, use a third-party distribution as described below.
5355

5456
If you must install scikit-learn and its dependencies with pip, you can install
55-
it as ``scikit-learn[alldeps]``. The most common use case for this is in a
56-
``requirements.txt`` file used as part of an automated build process for a PaaS
57-
application or a Docker image. This option is not intended for manual
58-
installation from the command line.
57+
it as ``scikit-learn[alldeps]``.
58+
59+
Scikit-learn plotting capabilities (i.e., functions start with "plot\_"
60+
and classes end with "Display") require Matplotlib (>= 1.5.1). For running the
61+
examples Matplotlib >= 1.5.1 is required. A few examples require
62+
scikit-image >= 0.12.3, a few examples require pandas >= 0.18.0.
63+
64+
.. warning::
65+
66+
Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4.
67+
Scikit-learn now requires Python 3.5 or newer.
68+
5969

6070
.. note::
6171

6272
For installing on PyPy, PyPy3-v5.10+, Numpy 1.14.0+, and scipy 1.1.0+
6373
are required.
6474

75+
.. _install_by_distribution:
6576

66-
For installation instructions for more distributions see
67-
:ref:`other distributions <install_by_distribution>`.
68-
For compiling the development version from source, or building the package
69-
if no distribution is available for your architecture, see the
70-
:ref:`advanced-installation`.
77+
Third party distributions of scikit-learn
78+
=========================================
7179

72-
Third-party Distributions
73-
==========================
74-
If you don't already have a python installation with numpy and scipy, we
75-
recommend to install either via your package manager or via a python bundle.
76-
These come with numpy, scipy, scikit-learn, matplotlib and many other helpful
77-
scientific and data processing libraries.
80+
Some third-party distributions provide versions of
81+
scikit-learn integrated with their package-management systems.
7882

79-
Available options are:
83+
These can make installation and upgrading much easier for users since
84+
the integration includes the ability to automatically install
85+
dependencies (numpy, scipy) that scikit-learn requires.
8086

81-
Canopy and Anaconda for all supported platforms
82-
-----------------------------------------------
87+
The following is an incomplete list of OS and python distributions
88+
that provide their own version of scikit-learn.
8389

84-
`Canopy
85-
<https://www.enthought.com/products/canopy>`_ and `Anaconda
86-
<https://www.anaconda.com/download>`_ both ship a recent
87-
version of scikit-learn, in addition to a large set of scientific python
88-
library for Windows, Mac OSX and Linux.
90+
Arch Linux
91+
----------
8992

90-
Anaconda offers scikit-learn as part of its free distribution.
93+
Arch Linux's package is provided through the `official repositories
94+
<https://www.archlinux.org/packages/?q=scikit-learn>`_ as
95+
``python-scikit-learn`` for Python.
96+
It can be installed by typing the following command:
9197

98+
.. code-block:: none
99+
100+
# pacman -S python-scikit-learn
101+
102+
103+
Debian/Ubuntu
104+
-------------
105+
106+
The Debian/Ubuntu package is splitted in three different packages called
107+
``python3-sklearn`` (python modules), ``python3-sklearn-lib`` (low-level
108+
implementations and bindings), ``python3-sklearn-doc`` (documentation).
109+
Only the Python 3 version is available in the Debian Buster (the more recent
110+
Debian distribution).
111+
Packages can be installed using ``apt-get``::
112+
113+
$ sudo apt-get install python3-sklearn python3-sklearn-lib
114+
python3-sklearn-doc
115+
116+
117+
Fedora
118+
------
119+
120+
The Fedora package is called ``python3-scikit-learn`` for the python 3 version,
121+
the only one available in Fedora30.
122+
It can be installed using ``dnf``::
123+
124+
$ sudo dnf install python3-scikit-learn
92125

93-
.. warning::
94126

95-
To upgrade or uninstall scikit-learn installed with Anaconda
96-
or ``conda`` you **should not use the pip command**. Instead:
127+
NetBSD
128+
------
97129

98-
To upgrade ``scikit-learn``::
130+
scikit-learn is available via `pkgsrc-wip
131+
<http://pkgsrc-wip.sourceforge.net/>`_:
99132

100-
conda update scikit-learn
133+
http://pkgsrc.se/wip/py-scikit_learn
101134

102-
To uninstall ``scikit-learn``::
103135

104-
conda remove scikit-learn
136+
MacPorts for Mac OSX
137+
--------------------
105138

106-
Upgrading with ``pip install -U scikit-learn`` or uninstalling
107-
``pip uninstall scikit-learn`` is likely fail to properly remove files
108-
installed by the ``conda`` command.
139+
The MacPorts package is named ``py<XY>-scikits-learn``,
140+
where ``XY`` denotes the Python version.
141+
It can be installed by typing the following
142+
command::
109143

110-
pip upgrade and uninstall operations only work on packages installed
111-
via ``pip install``.
144+
sudo port install py27-scikit-learn
145+
146+
or::
147+
148+
sudo port install py36-scikit-learn
149+
150+
151+
Canopy and Anaconda for all supported platforms
152+
-----------------------------------------------
153+
154+
`Canopy
155+
<https://www.enthought.com/products/canopy>`_ and `Anaconda
156+
<https://www.anaconda.com/download>`_ both ship a recent
157+
version of scikit-learn, in addition to a large set of scientific python
158+
library for Windows, Mac OSX and Linux.
159+
160+
Anaconda offers scikit-learn as part of its free distribution.
112161

113162

114163
WinPython for Windows
115164
-----------------------
116165

117166
The `WinPython <https://winpython.github.io/>`_ project distributes
118167
scikit-learn as an additional plugin.
119-

doc/other_distributions.rst

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0