Skip to content

Commit

Permalink
Update conda.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bclaremar authored Dec 19, 2023
1 parent 3ea3c0b commit 903589b
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions docs/cluster_guides/conda.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,70 @@ dependencies:
- That is, you cannot load the python module and use the packages therein inside your Conda environment.
## Extra to be merged
We have mirrored all major conda repositories directly on UPPMAX, on both Rackham and Bianca. These are updated every third day. We have the following channels available:
bioconda
biocore
conda-forge
Procedure
First load our conda module (there is no need to install you own miniconda, for most cases )
$ module load conda
This grants you access to the latest version of Conda and all major repositories on all UPPMAX systems.
Check the text output as conda is loaded, especially the first time, see below
The variable CONDA_ENVS_PATH contains the location of your environments. Set it to your project’s environments folder if you have one. Otherwise, the default is ~/.conda/envs. You may run source conda_init.sh to initialise your shell to be able to run conda activate and conda deactivate etc. Just remember that this command adds stuff to your shell outside the scope of the module system. REMEMBER TO conda clean -a once in a while to remove unused and unnecessary files.
Step 2 First time
The variable CONDA_ENVS_PATH contains the location of your environments. Set it to your project’s environments folder if you have one.
Otherwise, the default is ~/.conda/envs.
Example:
$ export CONDA_ENVS_PATH=/proj/snic2020-5-XXX
By choice:
Run conda init bash to initialise your shell (bash) to be able to run conda activate and conda deactivate etcetera instead of source activate. It will modify (append) your .bashrc file.
Step 3 Create the conda environment
Example:
$ conda create --name python36-env python=3.6 numpy=1.13.1 matplotlib=2.2.2
THE MAMBA ALTERNATIVE
mamba is a fast drop-in alternative to conda, using “libsolv” for dependency resolution. It is available from the conda module.
Example:
mamba create --name python37-env python=3.7 numpy=1.13.1 matplotlib=2.2.2
Step 4 Activate the conda environment by:
$ source activate python36-env
You will see that your prompt is changing to start with (python-36-env) to show that you are within an environment.
Step 5 Now do your work!
(python-36-env) $ <...>
Step 6 Deactivate
(python-36-env) $ source deactivate
Warning
Conda is known to create many small files. Your diskspace is not only limited in GB, but also in number of files (typically 300000 in $home).
Check your disk usage and quota limit with uquota
Do a conda clean -a once in a while to remove unused and unnecessary files
Conda in batch scripts
If you already have setup the CONDA_ENVS_PATH path and run 'conda init bash' a batch script containing a conda environment shall include
$ module load conda
$ conda activate <name of environment>

0 comments on commit 903589b

Please sign in to comment.