@@ -47,33 +47,52 @@ feature, code or documentation improvement).
47
47
48
48
.. prompt :: bash $
49
49
50
- git clone git://github.com/scikit-learn/scikit-learn.git # add --depth 1 if your connection is slow
51
- cd scikit-learn
50
+ git clone git://github.com/scikit-learn/scikit-learn.git # add --depth 1 if your connection is slow
51
+ cd scikit-learn
52
52
53
53
If you plan on submitting a pull-request, you should clone from your fork
54
54
instead.
55
55
56
+ #. Install a recent version of Python (3.9 is recommended at the time of writing)
57
+ for instance using Miniforge3 _. Miniforge provides a conda-based distribution
58
+ of Python and the most popular scientific libraries.
59
+
60
+ If you installed Python with conda, we recommend to create a dedicated
61
+ `conda environment `_ with all the build dependencies of scikit-learn
62
+ (namely NumPy _, SciPy _, and Cython _):
63
+
64
+ .. prompt :: bash $
65
+
66
+ conda create -n sklearn-env -c conda-forge python=3.9 numpy scipy cython
67
+ conda activate sklearn-env
68
+
69
+ #. **Alternative to conda: ** If you run Linux or similar, you can instead use
70
+ your system's Python provided it is recent enough (3.7 or higher
71
+ at the time of writing). In this case, we recommend to create a dedicated
72
+ virtualenv _ and install the scikit-learn build dependencies with pip:
73
+
74
+ .. prompt :: bash $
75
+
76
+ python3 -m venv sklearn-env
77
+ source sklearn-env/bin/activate
78
+ pip install wheel numpy scipy cython
79
+
56
80
#. Install a compiler with OpenMP _ support for your platform. See instructions
57
81
for :ref: `compiler_windows `, :ref: `compiler_macos `, :ref: `compiler_linux `
58
82
and :ref: `compiler_freebsd `.
59
83
60
- #. Optional (but recommended): create and activate a dedicated virtualenv _
61
- or `conda environment `_.
62
-
63
- #. Install NumPy _, SciPy _, and Cython _ and build the project with pip in
64
- :ref: `editable_mode `:
84
+ #. Build the project with pip in :ref: `editable_mode `:
65
85
66
86
.. prompt :: bash $
67
87
68
- pip install numpy scipy cython
69
- pip install --verbose --no-build-isolation --editable .
88
+ pip install --verbose --no-build-isolation --editable .
70
89
71
90
#. Check that the installed scikit-learn has a version number ending with
72
91
`.dev0 `:
73
92
74
93
.. prompt :: bash $
75
94
76
- python -c "import sklearn; sklearn.show_versions()"
95
+ python -c "import sklearn; sklearn.show_versions()"
77
96
78
97
#. Please refer to the :ref: `developers_guide ` and :ref: `pytest_tips ` to run
79
98
the tests on the module of your choice.
@@ -439,6 +458,7 @@ the base system and these steps will not be necessary.
439
458
.. _Homebrew : https://brew.sh
440
459
.. _virtualenv : https://docs.python.org/3/tutorial/venv.html
441
460
.. _conda environment : https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
461
+ .. _Miniforge3 : https://github.com/conda-forge/miniforge#miniforge3
442
462
443
463
Alternative compilers
444
464
=====================
0 commit comments