Create a custom conda environment on the cluster
This tutorial details how to create a custom conda environment on the cluster and use it for calculations:
- Use the directory
/cmmc/ptmp/<username>
where<username>
is your username. This is to make sure you do not exceed the file limits. - Go to the directory
cd /cmmc/ptmp/<username>
- Create an environment with command
conda create -p ./<envname>
(specify python version if needed) - activate env with
source activate <envname>
- To speed up things greatly, install mamba first,
conda install -c conda-forge mamba
- install ipykernel for later,
mamba install -c conda-forge ipykernel
- install other packages as needed
- install the environment as a kernel:
python -m ipykernel install --user --name <envname>
- Go to
/u/<username>/.local/share/jupyter/kernels/<envname>
- Open the file
kernel.json
and add:"env": { "PATH": "/cmmc/ptmp/<username>/<envname>/bin:${PATH}", "CONDA_PREFIX": "/cmmc/ptmp/<username>/<envname>" }
{}
- Now go to jupyterhub, File -> hub control panel -> Stop server -> start again
- Open a new notebook, choose the kernel
<envname>
and have fun!