8000 DOC Update installation instructions for macos/arm64 (#19146) · thomasjpfan/scikit-learn@158584a · GitHub
[go: up one dir, main page]

Skip to content

Commit 158584a

Browse files
authored
DOC Update installation instructions for macos/arm64 (scikit-learn#19146)
1 parent 8df0aa6 commit 158584a

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

doc/developers/advanced_installation.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ to enable OpenMP support:
238238

239239
- or install `libomp` with Homebrew to extend the default Apple clang compiler.
240240

241+
For Apple Silicon M1 hardware, only the conda-forge method below is known to
242+
work at the time of writing (January 2021). You can install the `macos/arm64`
243+
distribution of conda using the `miniforge installer
244+
<https://github.com/conda-forge/miniforge#miniforge>`_
245+
241246
macOS compilers from conda-forge
242247
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
243248

@@ -257,7 +262,7 @@ scikit-learn from source:
257262
.. prompt:: bash $
258263

259264
conda create -n sklearn-dev -c conda-forge python numpy scipy cython \
260-
joblib threadpoolctl pytest "compilers>=1.0.4,!=1.1.0" llvm-openmp
265+
joblib threadpoolctl pytest compilers llvm-openmp
261266
conda activate sklearn-dev
262267
make clean
263268
pip install --verbose --no-build-isolation --editable .

doc/install.rst

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ Installing the latest release
5959
<span class="sk-expandable" data-packager="pip" data-os="windows">Install the 64bit version of Python 3, for instance from <a href="https://www.python.org/">https://www.python.org</a>.</span
6060
><span class="sk-expandable" data-packager="pip" data-os="mac">Install Python 3 using <a href="https://brew.sh/">homebrew</a> (<code>brew install python</code>) or by manually installing the package from <a href="https://www.python.org">https://www.python.org</a>.</span
6161
><span class="sk-expandable" data-packager="pip" data-os="linux">Install python3 and python3-pip using the package manager of the Linux Distribution.</span
62-
><span class="sk-expandable" data-packager="conda"><a href="https://docs.conda.io/projects/conda/en/latest/user-guide/install/">Install conda</a> (no administrator permission required).</span>
62+
><span class="sk-expandable" data-packager="conda"
63+
>Install conda using the <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/install/">Anaconda or miniconda</a>
64+
installers or the <a href="https://https://github.com/conda-forge/miniforge#miniforge">miniforge</a> installers
65+
(no administrator permission required for any of those).</span>
6366
</div>
6467

6568
Then run:
@@ -106,17 +109,15 @@ In order to check your installation you can use
106109
</div>
107110

108111
Note that in order to avoid potential conflicts with other packages it is
109-
strongly recommended to use a virtual environment, e.g. python3 ``virtualenv``
110-
(see `python3 virtualenv documentation
111-
<https://docs.python.org/3/tutorial/venv.html>`_) or `conda environments
112+
strongly recommended to use a `virtual environment (venv)
113+
<https://docs.python.org/3/tutorial/venv.html>`_ or a `conda environment
112114
<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_.
113115

114-
Using an isolated environment makes possible to install a specific version of
115-
scikit-learn and its dependencies independently of any previously installed
116-
Python packages.
117-
In particular under Linux is it discouraged to install pip packages alongside
118-
the packages managed by the package manager of the distribution
119-
(apt, dnf, pacman...).
116+
Using such an isolated environment makes it possible to install a specific
117+
version of scikit-learn with pip or conda and its dependencies independently of
118+
any previously installed Python packages. In particular under Linux is it
119+
discouraged to install pip packages alongside the packages managed by the
120+
package manager of the distribution (apt, dnf, pacman...).
120121

121122
Note that you should always remember to activate the environment of your choice
122123
prior to running any Python command whenever you start a new terminal session.
@@ -127,8 +128,6 @@ and NumPy and SciPy are not recompiled from source, which can happen when using
127128
particular configurations of operating system and hardware (such as Linux on
128129
a Raspberry Pi).
129130

130-
If you must install scikit-learn and its dependencies with pip, you can install
131-
it as ``scikit-learn[alldeps]``.
132131

133132
Scikit-learn plotting capabilities (i.e., functions start with "plot\_"
134133
and classes end with "Display") require Matplotlib. The examples require
@@ -151,6 +150,28 @@ purpose.
151150
For installing on PyPy, PyPy3-v5.10+, Numpy 1.14.0+, and scipy 1.1.0+
152151
are required.
153152

153+
.. _install_on_apple_silicon_m1:
154+
155+
Installing on Apple Silicon M1 hardware
156+
=======================================
157+
158+
The recently introduced `macos/arm64` platform (sometimes also known as
159+
`macos/aarch64`) requires the open source community to upgrade the build
160+
configuation and automation to properly support it.
161+
162+
At the time of writing (January 2021), the only way to get a working
163+
installation of scikit-learn on this hardware is to install scikit-learn and its
164+
dependencies from the conda-forge distribution, for instance using the miniforge
165+
installers:
166+
167+
https://github.com/conda-forge/miniforge
168+
169+
The following issue tracks progress on making it possible to install
170+
scikit-learn from PyPI with pip:
171+
172+
https://github.com/scikit-learn/scikit-learn/issues/19137
173+
174+
154175
.. _install_by_distribution:
155176

156177
Third party distributions of scikit-learn

0 commit comments

Comments
 (0)
0