logo glicid


1. Conda and micromamba

conda is a software environment manager that is quite popular, particularly in the Python community, but which is not without its problems in the context of HPC use.

GLiCID administrators advise against its use, particularly if the affected software is already available in Guix.

However, all of the software provided by conda is not (yet) available in Guix. In this specific case, here is how to proceed.

1.1. Use micromamba instead of conda

A conda binary is available in Guix but presents bugs during initialization, it is recommended not to use it. To work around this problem, it is recommended to use micromamba instead of conda (see the mamba doc for more details). It is unfortunately (not yet) available in Guix, so you have to install it manually.

1.2. Install micromamba on GLiCID

A statically compiled version of micromamba is available in the artefacts Github du project Mamba. Here are the commands to run to install it locally on GLiCID.

# Télécharger micromamba depuis les packages Glicid
mkdir -p $HOME/.local/bin
wget -P $HOME/.local/bin https://s3.glicid.fr/pkgs/micromamba
chmod u+x $HOME/.local/bin/micromamba

# Initiliser micromamba
$HOME/.local/bin/micromamba -r /micromamba/$USER/ shell init --shell=bash --prefix=/micromamba/$USER/

# [OPTIONNEL] Ajouter un alias `conda`
echo -e '\n\n#Alias conda with micromamba\nalias conda=micromamba' >> ~/.bashrc

# Recharger le .bashrc
source ~/.bashrc
It is possible that the .bashrc file is not always sourced at the GLiCID login (investigations are underway). If this is not the case, remember to do source ~/.bashrc after each login to properly load micromamba.

From this point on, micromamba/conda is usable by the user

Clam automatically makes users' micromamba mount points You can verify the existence of this mount point with the command :
ls /micromamba/blondel-a@univ-nantes.fr/


envs  etc  pkgs

You must have your micromamba virtual environment in the /micromamba/login space

  Name  Active  Path

  base          /micromamba/the-login-name
  psi4   /micromamba/the-login-name/envs/psi4

1.3. Example of using micromamba

You can see that micromamba is very close in its usage to conda which is better known.

1.3.1. some micromamba commands

micromamba --version  # ou: `conda --version`
# -> 1.4.0

# Créer un environnment micromamba/conda
micromamba create -n my_env

# Activer l'environnement
micromamba activate my_env

# -> Votre prompt doit maintenant être préfixé avec: (my_env) ...

# Installer des packages depuis conda-forge
micromamba install -c conda-forge numpy

# Tester les packages
python -V
python -c "import numpy as np; print(np.__version__)"
# -> 1.24.2

# Désactiver l'environnement
micromamba deactivate

# Votre prompt ne doit plus être préfixé

1.3.2. In your slurm sbatch file

We will assume that you already have your conda environment available.

micromamba activate my_env(1)
1 my_env can be for example : /micromamba/login-name/envs/my_env