Installing miniforge on hoffman #
The version of conda on hoffman is ancient and really struggles to resolve dependency issues in environments. One way around this is to instead install miniconda or miniforge, and use that version of conda instead of the one pre-loaded on hoffman.
The last time I tried to install miniconda on hoffman (June 2026) there was an error (Installer requires GLIBC >=2.28, but system has 2.17) as the latest miniconda version is incompatible with the version of linux on hoffman. So I instead installed the latest version of miniforge (v26.3.2), which still worked. If an error like this occurs again you will likely need to install an earlier version of miniforge (or miniconda).
All the text written as code should be copied into your terminal and run. Text in blue you will need to edit.
Log into hoffman compute node #
Log into hoffman2 cluster in the terminal:
ssh USER_ID@hoffman2.idre.ucla.edu
edit USER_ID to your hoffman user ID
This will open into a login node, ie you will see:
(base) [USER_ID@loginX ~]
Log in to a compute node
qrsh -l h_rt=01:00:00,h_data=4G -pe shared 1 -now n
Note: this qrsh command is asking for 4GB RAM and 1 hour, which should be fine for the installation below.
This step might take a little while, it depends on how busy the cluster is (the more resources you request the longer it might take).
Eventually should see:
(base) [USER_ID@nXXXX ~]
Download and install miniforge #
Download miniforge:
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O ~/miniforge.sh
Install to home directory:
bash ~/miniforge.sh -b -p $HOME/miniforge3
NOTE if you get this error: Installer requires GLIBC >=2.28, but system has 2.17
You will have to install an earlier version of miniforge. Miniforge v26.3.2 is currently working on hoffman (June 2026).
Initialize shell:
$HOME/miniforge3/bin/conda init bash
Reload shell config:
source ~/.bashrc
Miniforge is already configured to use conda-forge (which is what we want!) For miniconda we would need to change the default channel to conda-forge, see below.
Example of how to create new environment #
eg for the video alignment/drift code we do:
conda create --override-channels -c conda-forge -n drift_env python=3.10 "numpy=1.23.*" "scipy=1.10.*" "matplotlib=3.8.*" "pandas=2.2.*" notebook ipykernel ipython moviepy=1.0.3 -y
Then activate the env:
conda activate drift_env
Now should show:
(drift_env) [USER_ID@nXXXX ~]
If you’re planning to use a jupyter lab notebook, within the active env register the kernel:
python -m ipykernel install --user --name=drift_env
Later when you open your notebook (eg after using h2jupynb.py) you can click on top right of notebook to get a drop down to select the environment you created to use with the notebook.
Note on job scripts #
To use this version of conda to activate your env in a job script replace:
module load anaconda3
with
source ~/.bashrc
Legacy miniconda install #
We were previously installing miniconda instead of miniforge but the hoffman cluster OS could no longer support the most recent version of miniconda (system has glibc 2.17, but the latest Miniconda now requires glibc ≥ 2.28), so we now use miniforge.
Here are the instructions for installing miniconda:
Download and install miniconda #
Download latest Miniconda installer (Linux, x86_64)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
Run the installer:
bash ~/miniconda.sh -b -p $HOME/miniconda3
Initialize shell:
$HOME/miniconda3/bin/conda init bash
Reload shell config:
source ~/.bashrc
set conda config to prefer conda-forge #
conda config --remove-key channels || true
conda config --add channels conda-forge
this will bring up a warning that you can ignore
conda config --set channel_priority strict
conda config --remove-key default_channels
conda config --add default_channels https://conda.anaconda.org/conda-forge