8000 DOC clean up installation doc organization (#10698) · scikit-learn/scikit-learn@a320c08 · GitHub
[go: up one dir, main page]

Skip to content

Commit a320c08

Browse files
amuellerjnothman
authored andcommitted
DOC clean up installation doc organization (#10698)
1 parent ba849f4 commit a320c08

File tree

4 files changed

+159
-225
lines changed

4 files changed

+159
-225
lines changed

doc/developers/advanced_installation.rst

Lines changed: 69 additions & 174 deletions
628C
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,98 @@ Advanced installation instructions
77

88
There are different ways to get scikit-learn installed:
99

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+
1014
* Install the version of scikit-learn provided by your
1115
:ref:`operating system or Python distribution <install_by_distribution>`.
12-
This is the quickest option for those who have operating systems that
13-
distribute scikit-learn.
14-
15-
* :ref:`Install an official release <install_official_release>`. This
16-
is the best approach for users who want a stable version number
17-
and aren't concerned about running a slightly older version of
18-
scikit-learn.
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.
1919

20-
* :ref:`Install the latest development version
20+
* :ref:`Building the package from source
2121
<install_bleeding_edge>`. This is best for users who want the
2222
latest-and-greatest features and aren't afraid of running
23-
brand-new code.
23+
brand-new code. This document describes how to build from source.
2424

2525
.. note::
2626

2727
If you wish to contribute to the project, you need to
2828
:ref:`install the latest development version<install_bleeding_edge>`.
2929

30+
.. _install_bleeding_edge:
3031

31-
.. _install_official_release:
32-
33-
Installing an official release
34-
==============================
32+
Building from source
33+
=====================
3534

3635
Scikit-learn requires:
3736

3837
- Python (>= 2.7 or >= 3.4),
3938
- NumPy (>= 1.8.2),
4039
- SciPy (>= 0.13.3).
4140

41+
Building Scikit-learn also requires
4242

43-
Mac OSX
44-
-------
43+
- Cython >=0.23
4544

46-
Scikit-learn and its dependencies are all available as wheel packages for OSX::
45+
Running tests requires
4746

48-
pip install -U numpy scipy scikit-learn
47+
- pytest
4948

49+
Some tests also require `pandas <https://pandas.pydata.org>`_.
5050

51-
Linux
52-
-----
51+
.. _git_repo:
52+
53+
Retrieving the latest code
54+
--------------------------
55+
56+
We use `Git <https://git-scm.com/>`_ for version control and
57+
`GitHub <https://github.com/>`_ for hosting our main repository.
5358

54-
At this time scikit-learn does not provide official binary packages for Linux
55-
so you have to build from source if you want the latest version.
56-
If you don't need the newest version, consider using your package manager to
57-
install scikit-learn. It is usually the easiest way, but might not provide the
58-
newest version.
59+
You can check out the latest sources with the command::
60+
61+
git clone git://github.com/scikit-learn/scikit-learn.git
62+
63+
If you want to build a stable version, you can ``git checkout <VERSION>``
64+
to get the code for that particular version, or download an zip archive of
65+
the version from github.
66+
67+
If you have all the build requirements installed (see below for details), you
68+
can build and install the package in the following way.
69+
70+
If you run the development version, it is cumbersome to reinstall the
71+
package each time you update the sources. Therefore it's recommended that you
72+
install in editable, which allows you to edit the code in-place. This
73+
builds the extension in place and creates a link to the development directory
74+
(see `the pip docs <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_)::
75+
76+
pip install --editable .
77+
78+
.. note::
79+
80+
This is fundamentally similar to using the command ``python setup.py develop``
81+
(see `the setuptool docs <http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode>`_).
82+
It is however preferred to use pip.
83+
84+
.. note::
85+
86+
If you decide to do an editable install you have to rerun::
87+
88+
pip install --editable .
89+
90+
every time the source code of a compiled extension is
91+
changed (for instance when switching branches or pulling changes from upstream).
92+
93+
On Unix-like systems, you can simply type ``make`` in the top-level folder to
94+
build in-place and launch all the tests. Have a look at the ``Makefile`` for
95+
additional utilities.
5996

6097
Installing build dependencies
61-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98+
=============================
99+
100+
Linux
101+
-----
62102

63103
Installing from source requires you to have installed the scikit-learn runtime
64104
dependencies, Python development headers and a working C/C++ compiler.
@@ -118,145 +158,9 @@ On Red Hat and clones (e.g. CentOS), install the dependencies using::
118158
sudo yum -y install gcc gcc-c++ numpy python-devel scipy
119159

120160

121-
Building scikit-learn with pip
122-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123-
124-
This is usually the fastest way to install or upgrade to the latest stable
125-
release::
126-
127-
pip install --user --install-option="--prefix=" -U scikit-learn
128-
129-
The ``--user`` flag asks pip to install scikit-learn in the ``$HOME/.local``
130-
folder therefore not requiring root permission. This flag should make pip
131-
ignore any old version of scikit-learn previously installed on the system while
132-
benefiting from system packages for numpy and scipy. Those dependencies can
133-
be long and complex to build correctly from source.
134-
135-
The ``--install-option="--prefix="`` flag is only required if Python has a
136-
``distutils.cfg`` configuration with a predefined ``prefix=`` entry.
137-
138-
139-
From source package
140-
~~~~~~~~~~~~~~~~~~~
141-
142-
download the source package from
143-
`pypi <https://pypi.python.org/pypi/scikit-learn>`__, unpack the sources and
144-
cd into the source directory.
145-
146-
This packages uses distutils, which is the default way of installing
147-
python modules. The install command is::
148-
149-
python setup.py install
150-
151-
or alternatively (also from within the scikit-learn source folder)::
152-
153-
pip install .
154-
155-
.. warning::
156-
157-
Packages installed with the ``python setup.py install`` command cannot
158-
be uninstalled nor upgraded by ``pip`` later. To properly uninstall
159-
scikit-learn in that case it is necessary to delete the ``sklearn`` folder
160-
from your Python ``site-packages`` directory.
161-
162-
163161
Windows
164162
-------
165163

166-
First, you need to install `numpy <http://www.numpy.org/>`_ and `scipy
167-
<http://www.scipy.org/>`_ from their own official installers.
168-
169-
Wheel packages (.whl files) for scikit-learn from `pypi
170-
<https://pypi.python.org/pypi/scikit-learn/>`_ can be installed with the `pip
171-
<https://pip.readthedocs.io/en/stable/installing/>`_ utility.
172-
Open a console and type the following to install or upgrade scikit-learn to the
173-
latest stable release::
174-
175-
pip install -U scikit-learn
176-
177-
If there are no binary packages matching your python, version you might
178-
to try to install scikit-learn and its dependencies from `christoph gohlke
179-
unofficial windows installers
180-
<https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn>`_
181-
or from a :ref:`python distribution <install_by_distribution>` instead.
182-
183-
184-
.. _install_by_distribution:
185-
186-
Third party distributions of scikit-learn
187-
=========================================
188-
189-
Some third-party distributions are now providing versions of
190-
scikit-learn integrated with their package-management systems.
191-
192-
These can make installation and upgrading much easier for users since
193-
the integration includes the ability to automatically install
194-
dependencies (numpy, scipy) that scikit-learn requires.
195-
196-
The following is an incomplete list of python and os distributions
197-
that provide their own version of scikit-learn.
198-
199-
200-
MacPorts for Mac OSX
201-
--------------------
202-
203-
The MacPorts package is named ``py<XY>-scikits-learn``,
204-
where ``XY`` denotes the Python version.
205-
It can be installed by typing the following
206-
command::
207-
208-
sudo port install py26-scikit-learn
209-
210-
or::
211-
212-
sudo port install py27-scikit-learn
213-
214-
215-
Arch Linux
216-
----------
217-
218-
Arch Linux's package is provided through the `official repositories
219-
<https://www.archlinux.org/packages/?q=scikit-learn>`_ as
220-
``python-scikit-learn`` for Python 3 and ``python2-scikit-learn`` for Python 2.
221-
It can be installed by typing the following command:
222-
223-
.. code-block:: none
224-
225-
# pacman -S python-scikit-learn
226-
227-
or:
228-
229-
.. code-block:: none
230-
231-
# pacman -S python2-scikit-learn
232-
233-
depending on the version of Python you use.
234-
235-
236-
NetBSD
237-
------
238-
239-
scikit-learn is available via `pkgsrc-wip <http://pkgsrc-wip.sourceforge.net/>`_:
240-
241-
http://pkgsrc.se/wip/py-scikit_learn
242-
243-
Fedora
244-
------
245-
246-
The Fedora package is called ``python-scikit-learn`` for the Python 2 version
247-
and ``python3-scikit-learn`` for the Python 3 version. Both versions can
248-
be installed using ``yum``::
249-
250-
$ sudo yum install python-scikit-learn
251-
252-
or::
253-
254-
$ sudo yum install python3-scikit-learn
255-
256-
257-
Building on windows
258-
-------------------
259-
260164
To build scikit-learn on Windows you need a working C/C++ compiler in
261165
addition to numpy, scipy and setuptools.
262166

@@ -358,16 +262,6 @@ build step::
358262
where ``my_compiler`` should be one of ``mingw32`` or ``msvc``.
359263

360264

361-
.. _install_bleeding_edge:
362-
363-
Bleeding Edge
364-
=============
365-
366-
See section :ref:`git_repo` on how to get the development version. Then follow
367-
the previous instructions to build from source depending on your platform.
368-
You will also require Cython >=0.23 in order to build the development version.
369-
370-
371265
.. _testing:
372266

373267
Testing
@@ -377,8 +271,9 @@ Testing scikit-learn once installed
377271
-----------------------------------
378272

379273
Testing requires having the `pytest
380-
<https://docs.pytest.org>`_ library. After
381-
installation, the package can be tested by executing *from outside* the
274+
<https://docs.pytest.org>`_ library. Some tests also require having
275+
`pandas <https://pandas.pydata.org/>` installed.
276+
After installation, the package can be tested by executing *from outside* the
382277
source directory::
383278

384279
$ pytest sklearn
@@ -388,7 +283,7 @@ eventually should finish with a message similar to::
388283

389284
=========== 8304 passed, 26 skipped, 4659 warnings in 557.76 seconds ===========
390285

391-
Otherwise, please consider posting an issue into the `bug tracker
286+
Otherwise, please consider posting an issue into the `GitHub issue tracker
392287
<https://github.com/scikit-learn/scikit-learn/issues>`_ or to the
393288
:ref:`mailing_lists` including the traceback of the individual failures
394289
and errors. Please include your operating system, your version of NumPy, SciPy

doc/developers/contributing.rst

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ See :ref:`new_contributors` to get started.
3434

3535
|
3636
37+
38+
In case you experience issues using this package, do not hesitate to submit a
39+
ticket to the
40+
`GitHub issue tracker <https://github.com/scikit-learn/scikit-learn/issues>`_. You are
41+
also welcome to post feature requests or pull requests.
42+
43+
44+
=======
3745
Ways to contribute
3846
==================
3947

@@ -144,54 +152,6 @@ feedback:
144152
for more details.
145153

146154

147-
.. _git_repo:
148-
149-
Retrieving the latest code
150-
==========================
151-
152-
We use `Git <https://git-scm.com/>`_ for version control and
153-
`GitHub <https://github.com/>`_ for hosting our main repository.
154-
155-
You can check out the latest sources with the command::
156-
157-
git clone git://github.com/scikit-learn/scikit-learn.git
158-
159-
or if you have write privileges::
160-
161-
git clone git@github.com:scikit-learn/scikit-learn.git
162-
163-
If you run the development version, it is cumbersome to reinstall the
164-
package each time you update the sources. It is thus preferred that
165-
you add the scikit-learn directory to your ``PYTHONPATH`` and build the
166-
extension in place::
167-
168-
python setup.py build_ext --inplace
169-
170-
171-
Another option is to install the package in editable mode if you change your
172-
code a lot and do not want to have to reinstall every time. This basically
173-
builds the extension in place and creates a link to the development directory
174-
(see `the pip docs <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_)::
175-
176-
pip install --editable .
177-
178-
.. note::
179-
180-
This is fundamentally similar to using the command ``python setup.py develop`` (see `the setuptool docs <http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode>`_). It is however preferred to use pip.
181-
182-
.. note::
183-
184-
If you decide to do an editable install you have to rerun::
185-
186-
python setup.py build_ext --inplace
187-
188-
every time the source code of a compiled extension is
189-
changed (for instance when switching branches or pulling changes from upstream).
190-
191-
On Unix-like systems, you can simply type ``make`` in the top-level folder to
192-
build in-place and launch all the tests. Have a look at the ``Makefile`` for
193-
additional utilities.
194-
195155

196156
Contributing code
197157
=================

0 commit comments

Comments
 (0)
0