Skip to content

Commit 8e85de9

Browse files
committed
content/installation: Update for miniforge as the primary installation method
1 parent 0f68da9 commit 8e85de9

File tree

1 file changed

+204
-67
lines changed

1 file changed

+204
-67
lines changed

content/installation.rst

Lines changed: 204 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,93 +2,214 @@ Software installation
22
=====================
33

44
This page contains instructions for installing the required software
5-
on your computer.
6-
Please make sure before the course that you have all the required software
7-
installed or some other way access to it. For example, the workshop could be done with a remote Jupyter
8-
server, as long as you can use the terminal from the Jupyter (you need
9-
to be able to access the command line for some lessons).
5+
on your computer. Please make sure before the course that you have
6+
all the required software installed or some other way access to it.
7+
For example, the workshop could be done with a remote Jupyter server,
8+
as long as you can use the terminal from the Jupyter (you need to be
9+
able to access the command line for some lessons).
10+
11+
12+
.. admonition:: Do you need help?
13+
:class: important
14+
15+
Participants from a partner institution are invited to install help
16+
sessions. (Hint: ask your institution to become a partner if it
17+
isn't already!)
18+
19+
Otherwise, if you need installation help, show this page to someone
20+
around you and they can probably help. These are relatively
21+
standard tools.
22+
23+
Don't be afraid to ask for help. Installing scientific software is
24+
*harder than it should be* and it helps to have someone guide you
25+
through it.
1026

11-
**If you need installation help, show this page to someone around you
12-
and they can probably do all you need**
1327

1428

1529
Generic list of tools required
1630
------------------------------
1731

1832
Note: The actual installation instructions are below. This is a
19-
generic description which will help those who already understand all
20-
of the tools.
33+
generic description, for those who already know how to install Python
34+
and conda.
2135

22-
* **Python 3** (Anaconda is recommended, it will include everything)
36+
* **Python 3** (A conda-based distribution is recommended, for example
37+
miniforge, miniconda, or Anaconda)
2338

2439
* With some extra packages installed. They are all included in
2540
Anaconda, and are listed in the ``environment.yml`` file you can
2641
find under miniconda below.
42+
2743
* Text editor (several lessons, can also be done through Jupyterlab)
2844
* Command-line shell (several lessons, can also be done through Jupyterlab)
2945
* git (not needed, this lesson is usually done as a demo)
3046

31-
.. admonition:: Generic instructions with miniconda and an environment file (advanced)
47+
48+
49+
Python
50+
------
51+
52+
We expect you to have a working Python installation with some common
53+
libraries. The `Anaconda Python distribution
54+
<https://docs.continuum.io/anaconda/install/>`__ conveniently packages
55+
everything, but its license does not allow large organizations to use
56+
it for research. **Thus, we currently recommend Miniforge, which
57+
includes the base and packages through a different, freely usable
58+
channel.**
59+
60+
.. admonition:: Python, conda, anaconda, miniforge, etc?
3261
:class: dropdown
3362

34-
This is the advanced, minimal method of installing the Python
35-
packages. For most people, we recommend Anaconda (below). You
36-
will actually learn about miniconda during the workshop. This
37-
doesn't provide the graphical Anaconda navigator, so you'll need to
38-
activate the miniconda environment using the command line.
63+
Unfortunately there's a lot of jargon. We'll go over this in the
64+
course but here is a crash course:
3965

40-
You can read how to install miniconda from the `CodeRefinery
41-
installation instructions
42-
<https://coderefinery.github.io/installation/conda/>`__.
66+
* **Python** is a programming language very commonly used in
67+
science, it's the topic of this course.
68+
* **Conda** is a package manager: it allows distributing and
69+
installing packages, and is designed for complex scientific
70+
code.
71+
* **Mamba** is a re-implementation of Conda to be much faster with
72+
resolving dependencies and installing things.
73+
* An **Environment** is a self-contained collections of packages
74+
which can be installed separately from others. They are used so
75+
each project can install what it needs without affecting others.
76+
* **Anaconda** is a commercial distribution of Python+Conda+many
77+
packages that all work together. It used to be freely usable for
78+
research, but since ~2023-2024 it's more limited. Thus, we don't
79+
recommend it (even though it has a nice graphical user interface).
80+
* **conda-forge** is another channel of distributing packages that
81+
is maintained by the community, and thus can be used by anyone.
82+
(Anaconda's parent company also hosts conda-forge packages)
83+
* **miniforge** is a distribution of conda pre-configured for
84+
conda-forge. It operates via the command line.
85+
* **miniconda** is a distribution of conda pre-configured to use
86+
the Anaconda channels.
4387

44-
Then `this environment file
45-
<https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml>`__
46-
contains all packages needed, and can be installed with:
88+
.. tabs::
4789

48-
.. code:: console
90+
.. group-tab:: Miniforge
4991

50-
$ conda env create -f https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml
92+
This is our recommended method - it can be used for any purpose
93+
and makes a strong base for the future.
5194

52-
Each time you start a new shell, you need to activate miniconda (if
53-
you don't do run ``conda init``), and then you need to activate the
54-
proper environment with ``conda activate python-for-scicomp``.
95+
Follow the `instructions on the miniforge web page
96+
<https://github.com/conda-forge/miniforge>`__. This installs
97+
the base, and from here other packages can be installed.
5598

56-
We might have missed some packages, though, which can be later
57-
installed with ``conda install``.
99+
..
100+
You can read how to install miniconda from the `CodeRefinery
101+
installation instructions
102+
<https://coderefinery.github.io/installation/conda/>`__.
58103
104+
Miniforge uses the command line - this gives you the most power
105+
but can feel unfamiliar. See the `command line crash course
106+
<https://scicomp.aalto.fi/scicomp/shell/>`__ for an intro.
59107

108+
Linux/MacOS: Each time you start a new shell, you can activate
109+
Miniforge by running ``source ~/miniforge3/bin/activate``. This
110+
is not needed if you choose "Do you wish to update your shell
111+
profile to automatically initialize conda?".
60112

61-
Python
62-
------
113+
Windows: Use the "Miniforge Prompt" to start Miniforge. This
114+
will set up all the paths so that ``conda`` and ``mamba`` are
115+
available.
63116

64-
We expect you to have a working Python installation with some common
65-
libraries. We recommend that you install the `Anaconda python
66-
distribution <https://docs.continuum.io/anaconda/install/>`__. The
67-
`Anaconda Navigator <https://docs.anaconda.com/navigator/>`__
68-
provides a convenient way to access the software.
117+
.. group-tab:: Anaconda
69118

70-
.. admonition:: Other options
71-
:class: toggle
119+
Anaconda is easier to get started with, but may be more limiting
120+
in the future.
121+
122+
The `Anaconda Navigator
123+
<https://docs.anaconda.com/navigator/>`__ provides a convenient
124+
way to access the software. It can be installed from that page.
125+
126+
Note the license of Anaconda - for organizations of more than 50
127+
people, it can't be used for research purposes without a license.
128+
129+
130+
.. group-tab:: Other options
131+
132+
Any other Python distribution which you can install libraries into
133+
would work, but because there are so many different ways to do this,
134+
we don't support them. You would need the extra libraries mentioned
135+
in the Miniforge instructions.
136+
137+
We don't currently provide a ``requirements.txt`` for installing
138+
the required packages without Conda/Mamba, though.
139+
140+
141+
Python for SciComp software environment
142+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143+
144+
.. tabs::
145+
146+
.. group-tab:: Miniforge
147+
148+
This `this environment file
149+
<https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml>`__
150+
contains all packages needed, and can be installed with:
151+
152+
.. code:: console
153+
154+
$ mamba env create -f https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml
155+
156+
Each time you start a new command line, you need to activate
157+
miniforge (if you don't do run the ``conda init`` option), and
158+
then you need to activate the proper environment with ``conda
159+
activate python-for-scicomp``.
160+
161+
.. group-tab:: Anaconda
162+
163+
Anaconda includes most of the things needed for the course
164+
automatically, but as of 2024 not everything. You can use the
165+
navigator to create new environments from this `this environment
166+
file
167+
<https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml>`__.
168+
You'll have to download it and then `import it
169+
<https://docs.anaconda.com/navigator/tutorials/manage-environments/#importing-an-environment>`__.
170+
171+
172+
.. group-tab:: Other options
173+
174+
**Minoconda, Anaconda command line, other conda/mamba command
175+
line tools**: see "Miniforge" instructions.
176+
177+
Virtual environments: we don't currently provide a
178+
``requirements.txt`` but many package names can probably be
179+
copied from the ``environment.yml`` file.
180+
181+
Any other Python distribution which you can install libraries into
182+
would work, but because there are so many different ways to do this,
183+
we don't support them. You would need the extra libraries mentioned
184+
in the Miniforge instructions.
72185

73-
We recommend Anaconda, Anaconda Navigator, and JupyterLab in these
74-
instructions because it is simple and can be used by everyone. As
75-
you advance in your career, we
76-
recommend that you explore other options as well, but
77-
that can come later.
78186

79-
Any other Python distribution which you can install libraries into
80-
would work, but because there are so many different ways to do this,
81-
we don't support them. You would need the extra libraries mentioned
82-
in the Miniconda instructions above.
83187

84188

85189
JupyterLab
86190
~~~~~~~~~~
87191

88192
We do most of the lessons from JupyterLab (and JupyterLab provides
89-
most of the other tools we need). If you install the full
90-
Anaconda distribution, this will be available and can be started
91-
either through Anaconda Navigator or command line.
193+
most of the other tools we need).
194+
195+
.. tabs::
196+
197+
.. group-tab:: Miniforge
198+
199+
First, start the Miniforge command line interface.
200+
201+
Linux/MacOS: remember, you may need to activate it by running
202+
``source ~/miniforge3/bin/activate`` if you didn't update your
203+
shell profile to automatically initialize conda.
204+
205+
.. group-tab:: Anaconda
206+
207+
If you install the full Anaconda distribution, this will be
208+
available and can be started either through Anaconda Navigator
209+
or command line.
210+
211+
Make sure the CodeRefinery environment is selected and you can
212+
start JupyterLab.
92213

93214

94215

@@ -101,20 +222,35 @@ Verification of Python and JupyterLab
101222
<https://youtu.be/OEX1ss_HCHc>`__ - if you can do this, you are
102223
ready to go for day one. Your exact steps may be a bit different.
103224

104-
**You should be able to start JupyterLab.** You can do this from the
105-
`Anaconda Navigator <https://docs.anaconda.com/anaconda/navigator/>`__ (recommended if you have it):
106225

107-
.. figure:: img/installation/anaconda-navigator-jupyterlab.png
108-
:class: with-border
226+
.. tabs::
109227

110-
Starting JupyterLab from the Anaconda Navigator.
228+
.. group-tab:: Miniforge
111229

112-
... or you can start JupyterLab from the command line:
230+
You can start JupyterLab from the command line:
113231

114-
.. code-block:: console
232+
.. code-block:: console
233+
234+
$ jupyter-lab
235+
(... Jupyter starts in a web browser)
236+
237+
238+
.. group-tab:: Anaconda
239+
240+
**You should be able to start JupyterLab.** You can do this from the
241+
`Anaconda Navigator <https://docs.anaconda.com/anaconda/navigator/>`__ (recommended if you have it):
242+
243+
.. figure:: img/installation/anaconda-navigator-jupyterlab.png
244+
:class: with-border
245+
246+
Starting JupyterLab from the Anaconda Navigator.
115247

116-
$ jupyter-lab
117-
(... Jupyter starts in a web browser)
248+
... or you can start JupyterLab from the command line:
249+
250+
.. code-block:: console
251+
252+
$ jupyter-lab
253+
(... Jupyter starts in a web browser)
118254
119255
120256
@@ -128,6 +264,7 @@ if you want.
128264
Starting a Jupyter Notebook from JupyterLab.
129265

130266

267+
131268
Text editor
132269
-----------
133270

@@ -171,10 +308,10 @@ test in advance:
171308
* From the Anaconda Navigator:
172309

173310
.. figure:: img/installation/anaconda-prompt.png
174-
:class: with-border
311+
:class: with-border
175312

176-
From the Anaconda Navigator, you can select "environments" on the
177-
left, then click on one, then the arrow, then "Open terminal".
313+
From the Anaconda Navigator, you can select "environments" on the
314+
left, then click on one, then the arrow, then "Open terminal".
178315

179316
* From your operating system's terminal applications, if you activate
180317
Anaconda.
@@ -190,15 +327,15 @@ Python version:
190327

191328
.. code-block:: console
192329
193-
$ python -V
330+
$ python3 -V
194331
Python 3.8.3
195332
196-
## Or python3...
197-
$ python3 -V
333+
## Or python... if it's installed as that
334+
$ python -V
198335
Python 3.8.3
199336
200-
Any version of Python 3 through a recent Anaconda should work for the
201-
course.
337+
Any recent version of Python 3 should work for the course (for example
338+
3.8 or higher).
202339

203340

204341

0 commit comments

Comments
 (0)