Skip to content

Commit c97ebea

Browse files
authored
use_isolated_environments.rst conda finished?
1 parent 3813e75 commit c97ebea

1 file changed

Lines changed: 27 additions & 22 deletions

File tree

docs/day2/use_isolated_environments.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ Conda
207207
208208
export CONDA_ENVS_PATH="path/to/your/project/(subdir)"
209209
export CONDA_PKG_DIRS="path/to/your/project/(subdir)"
210+
mamba create --prefix=$CONDA_ENVS_PATH/<conda env name>
210211
211212
- Solution 2
212213

@@ -225,7 +226,7 @@ Conda
225226
module load Miniforge/24.7.1-2-hpc1
226227
export CONDA_PKG_DIRS=/proj/courses-fall-2025/users/$USER
227228
export CONDA_ENVS_PATH=/proj/courses-fall-2025/users/$USER
228-
mamba create -n numpy-proj-39 python=3.9.5 -c conda-forge
229+
mamba create --prefix=$CONDA_ENVS_PATH/numpy-proj-39 python=3.9.5 -c conda-forge
229230
mamba activate spyder-env
230231
mamba install numpy
231232
which python # should point to the conda environment!
@@ -247,7 +248,6 @@ Conda
247248
- It includes a Python installation and some core system libraries and dependencies of Conda. It is a “best practice” to avoid installing additional packages into your base software environment.
248249

249250
.. admonition:: Conda cheat sheet
250-
:class: dropdown
251251

252252
- List packages in present environment: ``conda list``
253253
- List all environments: ``conda info -e`` or ``conda env list``
@@ -382,22 +382,18 @@ Breakout room according to grouping
382382
module load Miniforge/24.7.1-2-hpc1
383383
export CONDA_PKG_DIRS=/proj/courses-fall-2025/users/$USER
384384
export CONDA_ENVS_PATH=/proj/courses-fall-2025/users/$USER
385-
mamba create -n spyder-env spyder
385+
mamba create --prefix=$CONDA_ENVS_PATH/spyder-env python=3.12 spyder
386386
mamba activate spyder-env
387387
388-
**If you do not have matplotlib already outside any virtual environment**
389-
390-
- Install matplotlib in your ``.local`` folder, not in a virtual environment.
391-
- Do:
392-
393-
.. code-block:: console
388+
- Let's install packages that we need.
394389

395-
ml buildtool-easybuild/4.8.0-hpce082752a2 GCC/13.2.0 Python/3.11.5
396-
pip install --user matplotlib
390+
.. code-block::
391+
392+
conda install matplotlib pandas seaborn xarray dask numba
397393
398-
- Check that matplotlib is there by ``pip list``
394+
- Check that the above packages are there by ``conda list``.
399395

400-
We will put requirements files in the course project folder that you can build from in latter lessons
396+
We will put requirements files in the course project folder that you can build from in latter lessons.
401397

402398
- These will cover
403399

@@ -411,26 +407,33 @@ Breakout room according to grouping
411407

412408
.. code-block::
413409
414-
export CONDA_ENVS_PATH="/cfs/klemming/projects/supr/courses-fall-2025/$USER/"
415-
export CONDA_PKG_DIRS="/cfs/klemming/projects/supr/courses-fall-2025/$USER/"
410+
export CONDA_ENVS_PATH="/cfs/klemming/projects/supr/courses-fall-2025/$USER/" #only needed once per session
411+
export CONDA_PKG_DIRS="/cfs/klemming/projects/supr/courses-fall-2025/$USER/" #only needed once per session
416412
ml PDC/23.12
417413
ml miniconda3/24.7.1-0-cpeGNU-23.12
418-
conda create --prefix /cfs/klemming/projects/supr/courses-fall-2025/$USER/spyder-env
414+
conda create --prefix CONDA_ENVS_PATH/spyder-env python=3.12 spyder
419415
source activate spyder-env
420-
conda install spyder
421416
422-
2. Let's make a Jupyter installation based on Python 3.11.7
417+
- Let's install packages that we need.
418+
419+
.. code-block::
420+
421+
conda install matplotlib pandas seaborn xarray dask numba
422+
423+
- Check that the above packages are there by ``conda list``.
424+
425+
2. Let's make a Jupyter installation based on Python 3.11.7
423426

424427
.. code-block:: console
425428
426429
ml PDC/23.12
427430
ml miniconda3/24.7.1-0-cpeGNU-23.12
428431
export CONDA_ENVS_PATH="/cfs/klemming/projects/supr/courses-fall-2025/$USER/" #only needed once per session
429432
export CONDA_PKG_DIRS="/cfs/klemming/projects/supr/courses-fall-2025/$USER/" #only needed once per session
430-
conda create --prefix /cfs/klemming/projects/supr/courses-fall-2025/$USER/jupyter-env python=3.11.7
433+
conda create --prefix CONDA_ENVS_PATH/jupyter-env python=3.11.7
431434
conda activate jupyter-env
432435
conda install jupyter
433-
conda install matplotlib pandas seaborn
436+
conda install matplotlib pandas seaborn xarray dask numba
434437
435438
We will put requirements files in the course project folder that you can build from in latter lessons
436439

@@ -443,7 +446,7 @@ Breakout room according to grouping
443446
.. tab:: LUNARC
444447

445448
- Everything will work by just loading modules.
446-
- Go down to optional
449+
- Go down to the other exercises!
447450

448451
.. tab:: UPPMAX
449452

@@ -454,7 +457,7 @@ Breakout room according to grouping
454457
ml conda
455458
export CONDA_PKG_DIRS=/proj/hpc-python-uppmax/$USER
456459
export CONDA_ENVS_PATH=/proj/hpc-python-uppmax/$USER
457-
conda create -n spyder-env spyder -c conda-forge
460+
conda create --prefix CONDA_ENVS_PATH/spyder-env python=3.12 spyder -c conda-forge
458461
source activate spyder-env
459462
460463
We will put requirements files in the course project folder that you can build from in latter lessons
@@ -563,6 +566,8 @@ Breakout room according to grouping
563566
- Confirm package is now absent again
564567

565568

569+
570+
566571
.. challenge:: (optional) 5. Make a test environment and spread (venv)
567572

568573
Read `here <https://uppmax.github.io/HPC-python/extra/isolated_deeper.html#creator-developer>`_

0 commit comments

Comments
 (0)