diff --git a/doc/install.rst b/doc/install.rst index be924b012ce65..3d11b506473ee 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -33,16 +33,17 @@ Installing the latest release .. div:: install-instructions .. tab-set:: + :class: tabs-os - .. tab-item:: pip - :class-label: tab-6 - :sync: packager-pip + .. tab-item:: Windows + :class-label: tab-4 .. tab-set:: + :class: tabs-package-manager - .. tab-item:: Windows - :class-label: tab-4 - :sync: os-windows + .. tab-item:: pip + :class-label: tab-6 + :sync: package-manager-pip Install the 64-bit version of Python 3, for instance from the `official website `__. @@ -66,9 +67,21 @@ Installing the latest release python -m pip freeze # show all installed packages in the environment python -c "import sklearn; sklearn.show_versions()" - .. tab-item:: macOS - :class-label: tab-4 - :sync: os-macos + .. tab-item:: conda + :class-label: tab-6 + :sync: package-manager-conda + + .. include:: ./install_instructions_conda.rst + + .. tab-item:: MacOS + :class-label: tab-4 + + .. tab-set:: + :class: tabs-package-manager + + .. tab-item:: pip + :class-label: tab-6 + :sync: package-manager-pip Install Python 3 using `homebrew `_ (`brew install python`) or by manually installing the package from the `official website @@ -93,9 +106,21 @@ Installing the latest release python -m pip freeze # show all installed packages in the environment python -c "import sklearn; sklearn.show_versions()" - .. tab-item:: Linux - :class-label: tab-4 - :sync: os-linux + .. tab-item:: conda + :class-label: tab-6 + :sync: package-manager-conda + + .. include:: ./install_instructions_conda.rst + + .. tab-item:: Linux + :class-label: tab-4 + + .. tab-set:: + :class: tabs-package-manager + + .. tab-item:: pip + :class-label: tab-6 + :sync: package-manager-pip Python 3 is usually installed by default on most Linux distributions. To check if you have it installed, try: @@ -127,28 +152,12 @@ Installing the latest release python3 -m pip freeze # show all installed packages in the environment python3 -c "import sklearn; sklearn.show_versions()" - .. tab-item:: conda - :class-label: tab-6 - :sync: packager-conda - - Install conda using the `Anaconda or miniconda installers - `__ - or the `miniforge installers - `__ (no administrator - permission required for any of those). Then run: - - .. prompt:: bash - - conda create -n sklearn-env -c conda-forge scikit-learn - conda activate sklearn-env - - In order to check your installation, you can use: + .. tab-item:: conda + :class-label: tab-6 + :sync: package-manager-conda - .. prompt:: bash + .. include:: ./install_instructions_conda.rst - conda list scikit-learn # show scikit-learn version and location - conda list # show all installed packages in the environment - python -c "import sklearn; sklearn.show_versions()" Using an isolated environment such as pip venv or conda makes it possible to install a specific version of scikit-learn with pip or conda and its dependencies diff --git a/doc/install_instructions_conda.rst b/doc/install_instructions_conda.rst new file mode 100644 index 0000000000000..284a6925eeba9 --- /dev/null +++ b/doc/install_instructions_conda.rst @@ -0,0 +1,17 @@ +Install conda using the `Anaconda or miniconda installers +`__ or the +`miniforge installers `__ (no +administrator permission required for any of those). Then run: + +.. prompt:: bash + + conda create -n sklearn-env -c conda-forge scikit-learn + conda activate sklearn-env + +In order to check your installation, you can use: + +.. prompt:: bash + + conda list scikit-learn # show scikit-learn version and location + conda list # show all installed packages in the environment + python -c "import sklearn; sklearn.show_versions()" diff --git a/doc/scss/install.scss b/doc/scss/install.scss index 92e201f00a107..cb9c5357dea57 100644 --- a/doc/scss/install.scss +++ b/doc/scss/install.scss @@ -6,15 +6,55 @@ * https://sass-lang.com/guide/ */ -.install-instructions .sd-tab-set > label.sd-tab-label { - margin: 0; - text-align: center; +.install-instructions .sd-tab-set { + .sd-tab-content { + padding: 0.5rem 0 0 0; // Vertical gap between the two sets of nested tabs + background-color: transparent; + border: none; - &.tab-6 { - width: 50% !important; + p:first-child { + margin-top: 1rem !important; + } } - &.tab-4 { - width: calc(100% / 3) !important; + > label.sd-tab-label { + margin: 0 3px; // Horizontal gap within the same set of tabs + display: flex; + align-items: center; + justify-content: center; + border-radius: 5px !important; + + &.tab-6 { + width: calc((100% - var(--tab-caption-width, 0%)) / 2 - 6px) !important; + } + + &.tab-4 { + width: calc((100% - var(--tab-caption-width, 0%)) / 3 - 6px) !important; + } + } + + > input:checked + label.sd-tab-label { + transform: unset; + border: 2px solid var(--pst-color-primary); + } + + // Show tab captions on large screens + @media screen and (min-width: 960px) { + --tab-caption-width: 20%; + + &::before { + width: var(--tab-caption-width); + display: flex; + align-items: center; + font-weight: bold; + } + + &.tabs-os::before { + content: "Operating System"; + } + + &.tabs-packager::before { + content: "Package Manager"; + } } }