conda activate [environment]

pip install ipykernel

python -m ipykernel install --user --name=[environment] --display-name='display-[environment]'

Create sbatch file (jupyter.sh):

#!/bin/bash
#SBATCH --job-name=jupyter
#SBATCH --output=jupyter_logs/log-%J.txt
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --gres=gpu:1
#SBATCH --time=04:00:00

source /data/[username]/anaconda3/etc/profile.d/conda.sh
source ~/.bashrc
conda activate [environment]
jupyter-notebook --no-browser --ip=0.0.0.0 --NotebookApp.kernel_name=[environment]

sbatch jupyter.sh

Open sbatch log file and copy the [http://compute-permanent-node](<http://compute-permanent-node/>)... thing:

Untitled

go back to jupyter notebook, click on the jupyter notebook kernel, and then “select another kernel”

Untitled

click on “existing jupyter server”

Untitled

click on “Enter the URL of the running Jupyter server” (will need to scroll to the bottom if you have a bunch of jupyter servers)

Untitled

copy in the http://compute-permanent-node... link from earlier:

Untitled

select the kernel (or provide a name):

Untitled