Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
f241f5f1
Commit
f241f5f1
authored
9 years ago
by
Scott Andrews
Committed by
Andreas Mueller
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue #5830, capitalization in advanced installation documenation
parent
c726085e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/developers/advanced_installation.rst
+118
-118
118 additions, 118 deletions
doc/developers/advanced_installation.rst
with
118 additions
and
118 deletions
doc/developers/advanced_installation.rst
+
118
−
118
View file @
f241f5f1
...
...
@@ -52,31 +52,31 @@ Linux
-----
At this time scikit-learn does not provide official binary packages for Linux
so you have to build from source if you want the la
s
test version.
so you have to build from source if you want the latest version.
If you don't need the newest version, consider using your package manager to
install scikit-learn.
i
t is usually the easiest way, but might not provide the
install scikit-learn.
I
t is usually the easiest way, but might not provide the
newest version.
i
nstalling build dependencies
I
nstalling build dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i
nstalling from source requires you to have installed the scikit-learn runtime
dependencies,
p
ython development headers and a working C/C++ compiler.
u
nder
d
ebian-based operating systems, which include
u
buntu, if you have
p
ython 2 you can install all these requirements by issuing::
I
nstalling from source requires you to have installed the scikit-learn runtime
dependencies,
P
ython development headers and a working C/C++ compiler.
U
nder
D
ebian-based operating systems, which include
U
buntu, if you have
P
ython 2 you can install all these requirements by issuing::
sudo apt-get install build-essential python-dev python-setuptools \
python-numpy python-scipy \
libatlas-dev libatlas3gf-base
i
f you have
p
ython 3::
I
f you have
P
ython 3::
sudo apt-get install build-essential python3-dev python3-setuptools \
python3-numpy python3-scipy \
libatlas-dev libatlas3gf-base
o
n recent
d
ebian and
u
buntu (e.g.
u
buntu 13.04 or later) make sure that
atlas
is used to provide the implementation of the
blas
and
lapack
linear algebra
O
n recent
D
ebian and
U
buntu (e.g.
U
buntu 13.04 or later) make sure that
ATLAS
is used to provide the implementation of the
BLAS
and
LAPACK
linear algebra
routines::
sudo update-alternatives --set libblas.so.3 \
...
...
@@ -86,24 +86,24 @@ routines::
.. note::
i
n order to build the documentation and run the example code contains in
I
n order to build the documentation and run the example code contains in
this documentation you will need matplotlib::
sudo apt-get install python-matplotlib
.. note::
t
he above installs the
atlas
implementation of
blas
(the
b
asic
l
inear
a
lgebra
s
ubprograms library).
u
buntu 11.10 and later, and recent (testing) versions of
d
ebian,
offer an alternative implementation called
o
pen
blas
.
T
he above installs the
ATLAS
implementation of
BLAS
(the
B
asic
L
inear
A
lgebra
S
ubprograms library).
U
buntu 11.10 and later, and recent (testing) versions of
D
ebian,
offer an alternative implementation called
O
pen
BLAS
.
u
sing
o
pen
blas
can give speedups in some scikit-learn modules,
but can freeze joblib/multiprocessing prior to
o
pen
blas
version 0.2.8-4,
U
sing
O
pen
BLAS
can give speedups in some scikit-learn modules,
but can freeze joblib/multiprocessing prior to
O
pen
BLAS
version 0.2.8-4,
so using it is not recommended unless you know what you're doing.
i
f you do want to use
o
pen
blas
, then replacing
atlas
only requires a couple
of commands.
atlas
has to be removed, otherwise
n
um
p
y may not work::
I
f you do want to use
O
pen
BLAS
, then replacing
ATLAS
only requires a couple
of commands.
ATLAS
has to be removed, otherwise
N
um
P
y may not work::
sudo apt-get remove libatlas3gf-base libatlas-dev
sudo apt-get install libopenblas-dev
...
...
@@ -113,30 +113,30 @@ routines::
sudo update-alternatives --set liblapack.so.3 \
/usr/lib/lapack/liblapack.so.3
o
n
r
ed
h
at and clones (e.g.
c
ent
os
), install the dependencies using::
O
n
R
ed
H
at and clones (e.g.
C
ent
OS
), install the dependencies using::
sudo yum -y install gcc gcc-c++ numpy python-devel scipy
b
uilding scikit-learn with pip
B
uilding scikit-learn with pip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t
his is usually the fastest way to install or upgrade to the latest stable
T
his is usually the fastest way to install or upgrade to the latest stable
release::
pip install --user --install-option="--prefix=" -
u
scikit-learn
pip install --user --install-option="--prefix=" -
U
scikit-learn
t
he ``--user`` flag asks pip to install scikit-learn in the ``$
home
/.local``
folder therefore not requiring root permission.
t
his flag should make pip
T
he ``--user`` flag asks pip to install scikit-learn in the ``$
HOME
/.local``
folder therefore not requiring root permission.
T
his flag should make pip
ignore any old version of scikit-learn previously installed on the system while
benefiting from system packages for numpy and scipy.
t
hose dependencies can
benefiting from system packages for numpy and scipy.
T
hose dependencies can
be long and complex to build correctly from source.
t
he ``--install-option="--prefix="`` flag is only required if
p
ython has a
T
he ``--install-option="--prefix="`` flag is only required if
P
ython has a
``distutils.cfg`` configuration with a predefined ``prefix=`` entry.
f
rom source package
F
rom source package
~~~~~~~~~~~~~~~~~~~
download the source package from
...
...
@@ -144,7 +144,7 @@ download the source package from
cd into the source directory.
This packages uses distutils, which is the default way of installing
python modules.
t
he install command is::
python modules.
T
he install command is::
python setup.py install
...
...
@@ -154,27 +154,27 @@ or alternatively (also from within the scikit-learn source folder)::
.. warning::
p
ackages installed with the ``python setup.py install`` command cannot
be uninstalled nor upgraded by ``pip`` later.
t
o properly uninstall
P
ackages installed with the ``python setup.py install`` command cannot
be uninstalled nor upgraded by ``pip`` later.
T
o properly uninstall
scikit-learn in that case it is necessary to delete the ``sklearn`` folder
from your
p
ython ``site-packages`` directory.
from your
P
ython ``site-packages`` directory.
w
indows
W
indows
-------
f
irst, you need to install `numpy <http://www.numpy.org/>`_ and `scipy
F
irst, you need to install `numpy <http://www.numpy.org/>`_ and `scipy
<http://www.scipy.org/>`_ from their own official installers.
w
heel packages (.whl files) for scikit-learn from `pypi
W
heel packages (.whl files) for scikit-learn from `pypi
<https://pypi.python.org/pypi/scikit-learn/>`_ can be installed with the `pip
<https://pip.readthedocs.io/en/stable/installing/>`_ utility.
o
pen a console and type the following to install or upgrade scikit-learn to the
O
pen a console and type the following to install or upgrade scikit-learn to the
latest stable release::
pip install -
u
scikit-learn
pip install -
U
scikit-learn
i
f there are no binary packages matching your python, version you might
I
f there are no binary packages matching your python, version you might
to try to install scikit-learn and its dependencies from `christoph gohlke
unofficial windows installers
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn>`_
...
...
@@ -186,23 +186,23 @@ or from a :ref:`python distribution <install_by_distribution>` instead.
Third party distributions of scikit-learn
=========================================
s
ome third-party distributions are now providing versions of
S
ome third-party distributions are now providing versions of
scikit-learn integrated with their package-management systems.
t
hese can make installation and upgrading much easier for users since
T
hese can make installation and upgrading much easier for users since
the integration includes the ability to automatically install
dependencies (numpy, scipy) that scikit-learn requires.
t
he following is an incomplete list of python and os distributions
T
he following is an incomplete list of python and os distributions
that provide their own version of scikit-learn.
m
ac
p
orts for
m
ac
osx
M
ac
P
orts for
M
ac
OSX
--------------------
t
he
m
ac
p
orts package is named ``py<
xy
>-scikits-learn``,
where ``
xy
`` denotes the
p
ython version.
i
t can be installed by typing the following
T
he
M
ac
P
orts package is named ``py<
XY
>-scikits-learn``,
where ``
XY
`` denotes the
P
ython version.
I
t can be installed by typing the following
command::
sudo port install py26-scikit-learn
...
...
@@ -212,39 +212,39 @@ or::
sudo port install py27-scikit-learn
a
rch
l
inux
A
rch
L
inux
----------
a
rch
l
inux's package is provided through the `official repositories
A
rch
L
inux's package is provided through the `official repositories
<https://www.archlinux.org/packages/?q=scikit-learn>`_ as
``python-scikit-learn`` for
p
ython 3 and ``python2-scikit-learn`` for
p
ython 2.
i
t can be installed by typing the following command:
``python-scikit-learn`` for
P
ython 3 and ``python2-scikit-learn`` for
P
ython 2.
I
t can be installed by typing the following command:
.. code-block:: none
# pacman -
s
python-scikit-learn
# pacman -
S
python-scikit-learn
or:
.. code-block:: none
# pacman -
s
python2-scikit-learn
# pacman -
S
python2-scikit-learn
depending on the version of
p
ython you use.
depending on the version of
P
ython you use.
n
et
bsd
N
et
BSD
------
scikit-learn is available via `pkgsrc-wip <http://pkgsrc-wip.sourceforge.net/>`_:
http://pkgsrc.se/wip/py-scikit_learn
f
edora
F
edora
------
t
he
f
edora package is called ``python-scikit-learn`` for the
p
ython 2 version
and ``python3-scikit-learn`` for the
p
ython 3 version.
b
oth versions can
T
he
F
edora package is called ``python-scikit-learn`` for the
P
ython 2 version
and ``python3-scikit-learn`` for the
P
ython 3 version.
B
oth versions can
be installed using ``yum``::
$ sudo yum install python-scikit-learn
...
...
@@ -254,103 +254,103 @@ or::
$ sudo yum install python3-scikit-learn
b
uilding on windows
B
uilding on windows
-------------------
t
o build scikit-learn on
w
indows you need a working C/C++ compiler in
T
o build scikit-learn on
W
indows you need a working C/C++ compiler in
addition to numpy, scipy and setuptools.
p
icking the right compiler depends on the version of
p
ython (2 or 3)
and the architecture of the
p
ython interpreter, 32-bit or 64-bit.
y
ou can check the
p
ython version by running the following in ``cmd`` or
P
icking the right compiler depends on the version of
P
ython (2 or 3)
and the architecture of the
P
ython interpreter, 32-bit or 64-bit.
Y
ou can check the
P
ython version by running the following in ``cmd`` or
``powershell`` console::
python --version
and the architecture with::
python -c "import struct; print(struct.calcsize('
p
') * 8)"
python -c "import struct; print(struct.calcsize('
P
') * 8)"
t
he above commands assume that you have the
p
ython installation folder in your
path
environment variable.
T
he above commands assume that you have the
P
ython installation folder in your
PATH
environment variable.
32-bit
p
ython
32-bit
P
ython
-------------
f
or 32-bit python it is possible use the standalone installers for
F
or 32-bit python it is possible use the standalone installers for
`microsoft visual c++ express 2008 <http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe>`_
for
p
ython 2 or
m
icrosoft
v
isual
c
++
e
xpress 2010 for
p
ython 3.
for
P
ython 2 or
M
icrosoft
V
isual
C
++
E
xpress 2010 for
P
ython 3.
o
nce installed you should be able to build scikit-learn without any
O
nce installed you should be able to build scikit-learn without any
particular configuration by running the following command in the scikit-learn
folder::
python setup.py install
64-bit
p
ython
64-bit
P
ython
-------------
f
or the 64-bit architecture, you either need the full
v
isual
s
tudio or
the free
w
indows
sdk
s that can be downloaded from the links below.
F
or the 64-bit architecture, you either need the full
V
isual
S
tudio or
the free
W
indows
SDK
s that can be downloaded from the links below.
t
he
w
indows
sdk
s include the
msvc
compilers both for 32 and 64-bit
architectures.
t
hey come as a ``
grmsdkx_en_dvd
.iso`` file that can be mounted
T
he
W
indows
SDK
s include the
MSVC
compilers both for 32 and 64-bit
architectures.
T
hey come as a ``
GRMSDKX_EN_DVD
.iso`` file that can be mounted
as a new drive with a ``setup.exe`` installer in it.
-
f
or
p
ython 2 you need
sdk
**v7.0**: `
ms w
indows
sdk
for
w
indows 7 and .
net
f
ramework 3.5
sp
1
-
F
or
P
ython 2 you need
SDK
**v7.0**: `
MS W
indows
SDK
for
W
indows 7 and .
NET
F
ramework 3.5
SP
1
<https://www.microsoft.com/en-us/download/details.aspx?id=18950>`_
-
f
or
p
ython 3 you need
sdk
**v7.1**: `
ms w
indows
sdk
for
w
indows 7 and .
net
f
ramework 4
-
F
or
P
ython 3 you need
SDK
**v7.1**: `
MS W
indows
SDK
for
W
indows 7 and .
NET
F
ramework 4
<https://www.microsoft.com/en-us/download/details.aspx?id=8442>`_
b
oth
sdk
s can be installed in parallel on the same host.
t
o use the
w
indows
sdk
s, you need to setup the environment of a ``cmd`` console launched with the
following flags (at least for
sdk
v7.0)::
B
oth
SDK
s can be installed in parallel on the same host.
T
o use the
W
indows
SDK
s, you need to setup the environment of a ``cmd`` console launched with the
following flags (at least for
SDK
v7.0)::
cmd /
e:on /v:on
/
k
cmd /
E:ON /V:ON
/
K
t
hen configure the build environment with::
T
hen configure the build environment with::
set distutils_use_sdk
=1
set mss
dk=1
"
c
:\
p
rogram
f
iles\
m
icrosoft
sdk
s\
w
indows\v7.0\
s
etup\
w
indows
s
dk
v
er.exe" -q -version:v7.0
"
c
:\
p
rogram
f
iles\
m
icrosoft
sdk
s\
w
indows\v7.0\
b
in\
s
et
e
nv.cmd" /x64 /release
SET DISTUTILS_USE_SDK
=1
SET MSS
dk=1
"
C
:\
P
rogram
F
iles\
M
icrosoft
SDK
s\
W
indows\v7.0\
S
etup\
W
indows
S
dk
V
er.exe" -q -version:v7.0
"
C
:\
P
rogram
F
iles\
M
icrosoft
SDK
s\
W
indows\v7.0\
B
in\
S
et
E
nv.cmd" /x64 /release
f
inally you can build scikit-learn in the same ``cmd`` console::
F
inally you can build scikit-learn in the same ``cmd`` console::
python setup.py install
r
eplace ``v7.0`` by the ``v7.1`` in the above commands to do the same for
p
ython 3 instead of
p
ython 2.
R
eplace ``v7.0`` by the ``v7.1`` in the above commands to do the same for
P
ython 3 instead of
P
ython 2.
r
eplace ``/x64`` by ``/x86`` to build for 32-bit
p
ython instead of 64-bit
p
ython.
R
eplace ``/x64`` by ``/x86`` to build for 32-bit
P
ython instead of 64-bit
P
ython.
b
uilding binary packages and installers
B
uilding binary packages and installers
---------------------------------------
t
he ``.whl`` package and ``.exe`` installers can be built with::
T
he ``.whl`` package and ``.exe`` installers can be built with::
pip install wheel
python setup.py bdist_wheel bdist_wininst -b doc/logos/scikit-learn-logo.bmp
t
he resulting packages are generated in the ``dist/`` folder.
T
he resulting packages are generated in the ``dist/`` folder.
u
sing an alternative compiler
U
sing an alternative compiler
-----------------------------
i
t is possible to use `
m
in
gw
<http://www.mingw.org>`_ (a port of
gcc
to
w
indows
os
) as an alternative to
msvc
for 32-bit
p
ython.
n
ot that extensions built with
mingw32 can be redistributed as reusable packages as they depend on
gcc
runtime
I
t is possible to use `
M
in
GW
<http://www.mingw.org>`_ (a port of
GCC
to
W
indows
OS
) as an alternative to
MSVC
for 32-bit
P
ython.
N
ot that extensions built with
mingw32 can be redistributed as reusable packages as they depend on
GCC
runtime
libraries typically not installed on end-users environment.
t
o force the use of a particular compiler, pass the ``--compiler`` flag to the
T
o force the use of a particular compiler, pass the ``--compiler`` flag to the
build step::
python setup.py build --compiler=my_compiler install
...
...
@@ -360,62 +360,62 @@ where ``my_compiler`` should be one of ``mingw32`` or ``msvc``.
.. _install_bleeding_edge:
b
leeding
e
dge
B
leeding
E
dge
=============
s
ee section :ref:`git_repo` on how to get the development version.
t
hen follow
S
ee section :ref:`git_repo` on how to get the development version.
T
hen follow
the previous instructions to build from source depending on your platform.
You will also require Cython >=0.23 in order to build the development version.
.. _testing:
t
esting
T
esting
=======
t
esting scikit-learn once installed
T
esting scikit-learn once installed
-----------------------------------
t
esting requires having the `nose
<https://
nose.readthedocs.io/en/latest
/>`_ library.
a
fter
T
esting requires having the `nose
<https://
somethingaboutorange.com/mrl/projects/nose
/>`_ library.
A
fter
installation, the package can be tested by executing *from outside* the
source directory::
$ nosetests -v sklearn
u
nder
w
indows, it is recommended to use the following command (adjust the path
U
nder
W
indows, it is recommended to use the following command (adjust the path
to the ``python.exe`` program) as using the ``nosetests.exe`` program can badly
interact with tests that use ``multiprocessing``::
c
:\
p
ython34\python.exe -c "import nose; nose.main()" -v sklearn
C
:\
P
ython34\python.exe -c "import nose; nose.main()" -v sklearn
t
his should give you a lot of output (and some warnings) but
T
his should give you a lot of output (and some warnings) but
eventually should finish with a message similar to::
r
an 3246 tests in 260.618s
ok (skip
=20)
R
an 3246 tests in 260.618s
OK (SKIP
=20)
o
therwise, please consider posting an issue into the `bug tracker
O
therwise, please consider posting an issue into the `bug tracker
<https://github.com/scikit-learn/scikit-learn/issues>`_ or to the
:ref:`mailing_lists` including the traceback of the individual failures
and errors.
p
lease include your operati
o
n system, your version of
n
um
p
y,
s
ci
p
y
and errors.
P
lease include your operatin
g
system, your version of
N
um
P
y,
S
ci
P
y
and scikit-learn, and how you installed scikit-learn.
t
esting scikit-learn from within the source folder
T
esting scikit-learn from within the source folder
--------------------------------------------------
s
cikit-learn can also be tested without having the package
installed.
f
or this you must compile the sources inplace from the
S
cikit-learn can also be tested without having the package
installed.
F
or this you must compile the sources inplace from the
source directory::
python setup.py build_ext --inplace
t
est can now be run using nosetests::
T
est can now be run using nosetests::
nosetests -v sklearn/
t
his is automated by the commands::
T
his is automated by the commands::
make in
...
...
@@ -424,7 +424,7 @@ and::
make test
y
ou can also install a symlink named ``site-packages/scikit-learn.egg-link``
Y
ou can also install a symlink named ``site-packages/scikit-learn.egg-link``
to the development folder of scikit-learn with::
pip install --editable .
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment