Although Miniconda3 is not officially supported on this cluster, there has been significant demand for its use. This guide provides instructions on how to set up and work with Miniconda3, including creating and configuring Conda environments, as well as installing necessary packages.
By following this guide, you can take advantage of Conda’s powerful environment management features while working within the cluster environment.
First, start an interactive session with enough memory (e.g., 20GB) to work with Conda:
srun --mem 20G --pty bash
To access Miniconda3, load the appropriate Spack module:
module load spack miniconda3
Once Miniconda is loaded, set up the Conda environment configuration to customize the location where Conda stores packages and environments. Use the following commands:
source /usr/local/spack/opt/spack/linux-debian12-x86_64/gcc-12.2.0/miniconda3-24.3.0-iqeknetqo7ngpr57d6gmu3dg4rzlcgk6/etc/profile.d/conda.sh
Next, configure Conda to use specific directories for storing packages and environments. Replace PILOGIN and LOGIN with your actual login details:
conda config --prepend pkgs_dirs /sci/labs/<PILOGIN>/<LOGIN>/.conda/pkgs
conda config --prepend envs_dirs /sci/labs/<PILOGIN>/<LOGIN>/.conda/envs
To create a new Conda environment, use the following command:
conda create -n env
Replace env with your preferred environment name.
To activate the newly created environment:
conda activate env
Once inside your environment, add important Conda channels for your needs. The following channels are commonly used:
conda config --env --add channels defaults
conda config --env --add channels bioconda
conda config --env --add channels conda-forge
Once your environment is activated and configured, you can install packages using the conda install command. Replace <package-name>
with the desired package:
conda install <package-name>
For example:
conda install numpy
conda install pandas
List installed environments:
conda env list
Deactivate the current environment:
conda deactivate
Remove an environment:
conda remove --name env --all