In the examples below, I'll mainly be using Discover at NCCS as my guide for paths, etc., but it can be genericized
You want to make sure mamba, et al, do no cache files in your home dir as that can kill quota.
So:
mkdir -p $NOBACKUP/mamba-cache
export MAMBA_ROOT_PREFIX=$NOBACKUP/mamba-cache
and you might as well put MAMBA_ROOT_PREFIX
in your .bashrc
for convenience.
In the steps below, I'm using paths with my username, so of course change these
mkdir -p /discover/nobackup/mathomp4/Miniforge/TestpyD
cd /discover/nobackup/mathomp4/Miniforge/TestpyD
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -p /discover/nobackup/mathomp4/Miniforge/TestpyD/install
That gets the base. Now we make an environment and install there:
/discover/nobackup/mathomp4/Miniforge/TestpyD/install/bin/mamba create -y \
-p /discover/nobackup/mathomp4/Miniforge/TestpyD/install/envs/py3.12 python=3.12
/discover/nobackup/mathomp4/Miniforge/TestpyD/install/bin/mamba install -y -n py3.12 ipykernel
Just use that last command over and over to install stuff.
/discover/nobackup/mathomp4/Miniforge/TestpyD/install/bin/mamba install -y -n py3.12 numpy scipy ...
/discover/nobackup/mathomp4/Miniforge/TestpyD/install/envs/py3.12/bin/python3 -m ipykernel install --user --name py3.12 --display-name "Python 3.12"
You can call it whatever you like.