Skip to content

Commit d424646

Browse files
committed
content/installation: Split activating Python env from installing Python
- Since this is an important step.
1 parent 7a8e3bb commit d424646

File tree

1 file changed

+65
-29
lines changed

1 file changed

+65
-29
lines changed

content/installation.rst

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ Python
3737
------
3838

3939
We expect you to have a working Python installation with some common
40-
libraries. The `Anaconda Python distribution
41-
<https://docs.continuum.io/anaconda/install/>`__ conveniently packages
42-
everything, but its license has does not allow large organizations to
43-
use it for free (and has actually been enforced against universities).
44-
**Thus, we currently recommend Miniforge, which includes the base and
45-
packages through a different, freely usable channel.**
40+
libraries. **We currently recommend Miniforge, which includes the base and
41+
packages through a different, freely usable channel.** You can
42+
explore the options in the tabs below.
4643

4744
.. admonition:: Python, conda, anaconda, miniforge, etc?
4845
:class: dropdown
@@ -92,26 +89,17 @@ packages through a different, freely usable channel.**
9289
but can feel unfamiliar. See the `command line crash course
9390
<https://scicomp.aalto.fi/scicomp/shell/>`__ for an intro.
9491

95-
Linux/MacOS: Each time you start a new command line terminal,
96-
you can activate Miniforge by running::
97-
98-
$ source ~/miniforge3/bin/activate
99-
$ # This is not needed if you choose yes for "Do you wish
100-
$ # to update your shell profile to automatically initialize
101-
$ # conda?" during installation.
102-
103-
Windows: Use the "Miniforge Prompt" to start Miniforge. This
104-
will set up everything so that ``conda`` and ``mamba`` are
105-
available.
106-
10792
.. group-tab:: Anaconda
10893

10994
Anaconda is easier to get started with, but may be more limiting
110-
in the future.
95+
in the future. The Anaconda Navigator provides a graphical
96+
interface to most of what you would need.
11197

112-
The `Anaconda Navigator
113-
<https://docs.anaconda.com/navigator/>`__ provides a convenient
114-
way to access the software. It can be installed from that page.
98+
The `Anaconda Python distribution
99+
<https://docs.continuum.io/anaconda/install/>`__ conveniently packages
100+
everything, but its license has does not allow large organizations to
101+
use it for free (and has actually been enforced against
102+
universities).
115103

116104
Note the license of Anaconda - there were recently issues with
117105
it being used by large universities for free, and this is not
@@ -128,8 +116,50 @@ packages through a different, freely usable channel.**
128116
the required packages without Conda/Mamba, though.
129117

130118

119+
120+
Starting Python
121+
---------------
122+
123+
You need to Python in a way that activates conda/mamba.
124+
125+
.. tabs::
126+
127+
.. group-tab:: Miniforge
128+
129+
Linux/MacOS: Each time you start a new command line terminal,
130+
you can activate Miniforge by running. This is needed so that
131+
Miniforge is usable wherever you need, but doesn't affect any
132+
other software on your computer (this is not needed if you
133+
choose "Do you wish to update your shell profile to
134+
automatically initialize conda?", but then it will always be
135+
active)::
136+
137+
$ source ~/miniforge3/bin/activate
138+
139+
Windows: Use the "Miniforge Prompt" to start Miniforge. This
140+
will set up everything so that ``conda`` and ``mamba`` are
141+
available.
142+
143+
.. group-tab:: Anaconda
144+
145+
The `Anaconda Navigator
146+
<https://docs.anaconda.com/navigator/>`__ provides a convenient
147+
way to access the software. It can be installed from that page.
148+
149+
150+
.. group-tab:: Other options
151+
152+
You are on your own here.
153+
154+
131155
Python for SciComp software environment
132-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156+
---------------------------------------
157+
158+
Once Python and conda/mamba are installed, you can use it to install
159+
an environment. An **environment** is a self-contained set of extra
160+
libraries - different projects can use different environments to not
161+
interfere with each other. This environment will have all of the
162+
software needed for this particular course.
133163

134164
.. tabs::
135165

@@ -139,14 +169,16 @@ Python for SciComp software environment
139169
<https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml>`__
140170
contains all packages needed for the course, and can be
141171
installed with (there may be lots of warning messages: this is OK
142-
if it still goes through)::
172+
if it still goes through).
173+
174+
Linux / MacOS / Windows:
143175

144176
$ mamba env create -f https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml
145177

146178
Each time you start a new command line, you need to activate
147-
miniforge and this environment.
179+
miniforge and this environment:
148180

149-
Linux/MacOX::
181+
Linux/MacOS::
150182

151183
$ source ~/miniforge3/bin/activate
152184
$ conda activate python-for-scicomp
@@ -168,7 +200,9 @@ Python for SciComp software environment
168200

169201
When running this course's exercise, make sure the
170202
``python-for-scicomp`` environment is activated before starting
171-
Jupyter or any code.
203+
JupyterLab or any code. You need to start termnials or
204+
JupyterLab from the Anaconda Navigator for the
205+
``python-for-scicomp`` environment to be used.
172206

173207
.. group-tab:: Other options
174208

@@ -186,10 +220,12 @@ Python for SciComp software environment
186220
we don't support them. You would need the extra libraries mentioned
187221
in the Miniforge instructions.
188222

223+
Remember you need to activate the environment each time you use it.
224+
189225

190226

191227
JupyterLab
192-
~~~~~~~~~~
228+
----------
193229

194230
We do most of the lessons from JupyterLab (and JupyterLab provides
195231
most of the other tools we need).
@@ -226,7 +262,7 @@ most of the other tools we need).
226262

227263

228264
Verification of Python and JupyterLab
229-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265+
-------------------------------------
230266

231267
.. admonition:: Watch the video
232268

0 commit comments

Comments
 (0)