Conda
Guidance last updated: 20 October 2026
Conda manages environments containing Python and other software dependencies. Use it when your project needs packages or non-Python dependencies supplied by Conda channels. The Anaconda module provides Conda on Stanage. For a personal installation, see Miniforge (recommended).
For ordinary Python projects and environments using HPC module-provided
packages such as mpi4py, see Python on Stanage.
Loading Conda
After connecting to Stanage (see Establishing a SSH connection), start an interactive session:
salloc
Anaconda Python can be loaded with one of the following:
module load Anaconda3/2025.06-1
module load Anaconda3/2024.02-1
module load Anaconda3/2022.10
module load Anaconda3/2022.05
module load Anaconda3/2021.11
module load Anaconda3/2020.11
module load Anaconda3/2019.07
module load Anaconda3/2025.06-1
module load Anaconda3/2024.02-1
module load Anaconda3/2022.10
module load Anaconda3/2022.05
module load Anaconda3/2021.11
module load Anaconda3/2020.11
module load Anaconda3/2019.07
The shared base Conda environment includes Python and other packages.
Create your own environment to install or change packages; do not modify the
shared installation.
Initialise Conda’s shell functions after loading the module:
source "$EBROOTANACONDA3/etc/profile.d/conda.sh"
This enables conda activate and conda deactivate in the current shell,
including batch jobs, without running conda init.
Creating a Conda Environment
These examples explicitly select conda-forge. --override-channels prevents
other configured channels from being used for these commands.
Conda environments share files with the package cache using hard links where possible; copies may be required when the cache and environment are on different filesystems.
To create an environment with Python 3.13, NumPy and pip you can run:
conda create --override-channels --channel conda-forge -n mynumpy python=3.13 numpy pip
This installs compatible Python 3.13 and NumPy packages and creates an
environment named mynumpy.
You can request specific versions of Python and packages, provided they are available from conda-forge:
conda create --override-channels --channel conda-forge -n myscience python=3.13 numpy scipy pip
If you wish to modify an existing environment, such as one of the anaconda
installations, you can clone that environment:
conda create --override-channels --channel conda-forge --clone myscience -n myexperiment
This will create an environment called myexperiment which has all the
same conda packages as the myscience environment.
How to avoid large conda environments filling up your home directory
Home directories have limited space and can often reach their quota limit. Conda environments exponentionally take up space, if you have or want to create one or more large Conda environments (e.g. containing bulky Deep Learning packages such as TensorFlow or PyTorch) then there’s a risk you’ll quickly use up your home directory’s storage quota.
To avoid this, build your conda environments in a fastdata area
Create a
.condarcfile in your home directory if it does not already exist.Add an
envs_dirs:andpkgs_dirs:section to your.condarcfile as shown below:
pkgs_dirs:
- /mnt/parscratch/users/$USER/anaconda/.pkg-cache/
envs_dirs:
- /mnt/parscratch/users/$USER/anaconda/.envs
We recommend users create their own personal folder in the /fastdata area. As this doesn’t exist by default, you can create it with safe permissions. See fastdata area
Then create
.envsand.pkg-cachedirectories in your fastdata area as shown below:
mkdir -p /mnt/parscratch/users/$USER/anaconda/.pkg-cache/ /mnt/parscratch/users/$USER/anaconda/.envs
Installations of environments and package caching should now occur in your fastdata area
Using conda Environments
Once the conda module is loaded you have to load or create the desired conda environments. For the documentation on conda environments see the conda documentation.
You can load a conda environment with:
conda activate myexperiment
where myexperiment is the name of the environment, and unload one with:
conda deactivate
which will return you to the previous environment.
It is possible to list all the available environments with:
conda env list
Installing Packages Inside a Conda Environment
Once you have activated your own environment you can install additional packages
or different versions of packages into it. There are two methods for doing
this, conda and pip, if a package is available through conda it is
strongly recommended that you use conda to install packages. You can search for
packages using conda:
conda search --override-channels --channel conda-forge pandas
then install the package using:
conda install --override-channels --channel conda-forge pandas
if you are not in your environment you will get a permission denied error when trying to install packages, if this happens, create or activate an environment you own.
If a package is not available through Conda, search for it on PyPI and install it in your activated environment:
python -m pip install colormath
Install Conda packages first, then use pip for any remaining packages.
Using Conda and Python in a batch job
Create an example batch submission script called myscript.slurm that is similar to the following:
#!/bin/bash
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=2000
#SBATCH --time=10:00
export SLURM_EXPORT_ENV=ALL
module load Anaconda3/2025.06-1
source "$EBROOTANACONDA3/etc/profile.d/conda.sh"
# We assume that the conda environment 'myexperiment' has already been created
conda activate myexperiment
srun python mywork.py
Then submit this to Slurm by running:
sbatch myscript.slurm
Further Conda Python Learning Resources
The resources and training courses below may be of interest:
IT Services provide RIT-301 to RIT-303 Intro to Advanced Python courses which you can find details for at https://sites.google.com/sheffield.ac.uk/research-training/
Getting started with conda, a 20-minute guide.
Installing a personal copy of Conda
Miniforge is recommended for a new personal installation. It includes Conda and Mamba and uses conda-forge as its default package channel, matching the examples on this page. Miniconda remains an alternative.
Miniforge (recommended)
After connecting to Stanage (see Establishing a SSH connection), start an interactive session:
salloc
The following example uses the Linux x86_64 installer for Stanage from the official Miniforge releases:
installer=Miniforge3-26.7.2-0-Linux-x86_64.sh
wget "https://github.com/conda-forge/miniforge/releases/download/26.7.2-0/$installer"
wget "https://github.com/conda-forge/miniforge/releases/download/26.7.2-0/$installer.sha256"
sha256sum --check "$installer.sha256"
Continue only if the checksum check reports OK. Install into a new directory
under your home directory:
mkdir -p "$HOME/software/installs"
bash "$installer" -b -p "$HOME/software/installs/miniforge"
The -b option runs the installation without interactive prompts and does
not initialise your shell. Do not run conda init on Stanage: automatic
activation can interfere with the cluster’s Python and Anaconda modules.
To make the installation available through a personal module, create
$HOME/modules/miniforge.lua:
mkdir -p "$HOME/modules"
nano "$HOME/modules/miniforge.lua"
Use the following Lua module file:
help("Makes my personal Miniforge installation available.")
whatis("Description: Personal Miniforge installation")
whatis("URL: https://conda-forge.org/download/")
conflict("Anaconda3")
conflict("miniconda")
local root = os.getenv("HOME") .. "/software/installs/miniforge"
setenv("MINIFORGE_DIR", root)
prepend_path("PATH", pathJoin(root, "bin"))
See Making software available via a custom module file for more information. Make your module available and load it:
module use "$HOME/modules"
module load miniforge
source "$MINIFORGE_DIR/etc/profile.d/conda.sh"
conda activate base
Initialise the shell functions with source in each new session before
using conda activate or conda deactivate. You can then create and
activate environments using the examples above. Use conda deactivate
before unloading the module.
For batch jobs, replace the Anaconda module and shell-function setup in the
example above with these Miniforge commands. Keep export SLURM_EXPORT_ENV=ALL
so that srun inherits your activated environment.
Warning
Use only one Conda installation in a session. Do not load Anaconda3,
Miniforge or Miniconda together. The module’s conflict checks prevent loading
it when Anaconda3 or a module named miniconda is already loaded;
they do not detect installations activated directly from your shell.
Miniconda (alternative)
If you need Miniconda, follow the
official Miniconda installation instructions
and install it into $HOME/software/installs/miniconda. Do not initialise
your shell during installation or run conda init afterwards.
In a session without another Conda installation loaded or activated, enable its shell functions and activate it with:
source "$HOME/software/installs/miniconda/etc/profile.d/conda.sh"
conda activate base
Use the explicit --override-channels --channel conda-forge commands above
when creating environments or installing packages from conda-forge.
Installation notes
Anaconda3
Anaconda3 was installed using Easybuild, build details can be found in $EBROOTANACONDA3/easybuild with a given module loaded.