Conda Environment#
Conda is an open-source package and environment management system that allows you to create isolated environments with specific Python versions and packages. On the cluster, Conda is available via the Miniconda module. Upon loading the module, the base Conda environment is automatically activated.
Module Alias
The miniconda module is the recommended interface. Internally, it loads the Miniforge distribution, which is fully compatible with Miniconda and uses the conda-forge ecosystem.
Quick Reference#
| Task | Command |
|---|---|
| Load Conda module | module load miniconda |
| Create environment | conda create -n myenv python=3.11 |
| Activate environment | conda activate myenv |
| Deactivate environment | conda deactivate |
| List environments | conda env list |
| Install package | conda install package_name |
| Remove package | conda remove package_name |
| List packages | conda list |
| Remove environment | conda env remove -n myenv |
| Clean cache | conda clean --all |
Getting Started#
Loading the Module#
Base Environment
Loading the Miniconda module automatically activates the base Conda environment. Avoid installing packages into base — always create a project-specific environment instead.
Creating and Activating an Environment#
Using Conda in SLURM Jobs#
Best Practices#
- Never install into
base— always create project-specific environments. - Clean up unused environments to conserve disk quota — Conda environments can be large.
- Prefer Conda over pip where possible; use pip only for packages unavailable in Conda.
Conda environments can consume significant disk space over time. Run
conda clean --allperiodically to remove unused packages and caches.
Troubleshooting#
Package Conflicts#
Slow Installation:#
Modern Conda includes the libmamba solver, which significantly improves installation speed. Enable it once, then use Conda normally: