From a41fcb0b3c68203c792ed1ddd4fed73c807c30cb Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Sun, 10 Jan 2021 19:25:14 +0100 Subject: [PATCH 1/2] Update installation instructions for macos/arm64 --- doc/developers/advanced_installation.rst | 7 +++- doc/install.rst | 47 ++++++++++++++++++------ 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/doc/developers/advanced_installation.rst b/doc/developers/advanced_installation.rst index fdda0076428af..7b305c13200a7 100644 --- a/doc/developers/advanced_installation.rst +++ b/doc/developers/advanced_installation.rst @@ -238,6 +238,11 @@ to enable OpenMP support: - or install `libomp` with Homebrew to extend the default Apple clang compiler. +For Apple Silicon M1 hardware, only the conda-forge method below is known to +work at the time of writing (January 2021). You can install the `macos/arm64` +distribution of conda using the `miniforge installer +`_ + macOS compilers from conda-forge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -257,7 +262,7 @@ scikit-learn from source: .. prompt:: bash $ conda create -n sklearn-dev -c conda-forge python numpy scipy cython \ - joblib threadpoolctl pytest "compilers>=1.0.4,!=1.1.0" llvm-openmp + joblib threadpoolctl pytest compilers llvm-openmp conda activate sklearn-dev make clean pip install --verbose --no-build-isolation --editable . diff --git a/doc/install.rst b/doc/install.rst index 57cb489a11262..8451ba72cf980 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -59,7 +59,10 @@ Installing the latest release Install the 64bit version of Python 3, for instance from https://www.python.org.Install Python 3 using homebrew (brew install python) or by manually installing the package from https://www.python.org.Install python3 and python3-pip using the package manager of the Linux Distribution.Install conda (no administrator permission required). + >Install conda using the Anaconda or miniconda + installers or the miniforge installers + (no administrator permission required for any of those). Then run: @@ -106,17 +109,15 @@ In order to check your installation you can use Note that in order to avoid potential conflicts with other packages it is -strongly recommended to use a virtual environment, e.g. python3 ``virtualenv`` -(see `python3 virtualenv documentation -`_) or `conda environments +strongly recommended to use a `virtual environment (venv) +`_ or a `conda environment `_. -Using an isolated environment makes possible to install a specific version of -scikit-learn and its dependencies independently of any previously installed -Python packages. -In particular under Linux is it discouraged to install pip packages alongside -the packages managed by the package manager of the distribution -(apt, dnf, pacman...). +Using such an isolated environment makes it possible to install a specific +version of scikit-learn with pip or conda and its dependencies independently of +any previously installed Python packages. In particular under Linux is it +discouraged to install pip packages alongside the packages managed by the +package manager of the distribution (apt, dnf, pacman...). Note that you should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session. @@ -127,8 +128,8 @@ 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). -If you must install scikit-learn and its dependencies with pip, you can install -it as ``scikit-learn[alldeps]``. +If you must install scikit-learn and all its optional dependencies with pip, you +can install it as ``scikit-learn[alldeps]``. Scikit-learn plotting capabilities (i.e., functions start with "plot\_" and classes end with "Display") require Matplotlib. The examples require @@ -151,6 +152,28 @@ purpose. For installing on PyPy, PyPy3-v5.10+, Numpy 1.14.0+, and scipy 1.1.0+ are required. +.. _install_on_apple_silicon_m1: + +Installing on Apple Silicon M1 hardware +======================================= + +The recently introduced `macos/arm64` platform (sometimes also known as +`macos/aarch64`) requires the open source community to upgrade the build +configuation and automation to properly support it. + +At the time of writing (January 2021), the only way to get a working +installation of scikit-learn on this hardware is to install scikit-learn and its +dependencies from the conda-forge distribution, for instance using the miniforge +installers: + +https://github.com/conda-forge/miniforge + +The following issue tracks progress on making it possible to install +scikit-learn from PyPI with pip: + +https://github.com/scikit-learn/scikit-learn/issues/19137 + + .. _install_by_distribution: Third party distributions of scikit-learn From 171b6941b794512cb7048ecb309012b7c7bbcb6d Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Mon, 11 Jan 2021 08:45:08 +0100 Subject: [PATCH 2/2] Update doc/install.rst --- doc/install.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index 8451ba72cf980..7912cc4dc4df6 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -128,8 +128,6 @@ 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). -If you must install scikit-learn and all its optional dependencies with pip, you -can install it as ``scikit-learn[alldeps]``. Scikit-learn plotting capabilities (i.e., functions start with "plot\_" and classes end with "Display") require Matplotlib. The examples require