Skip to content

Jupyter Notebook

Jupyter Notebook on Pathfinder

Start an interactive job on a compute node:

srun -p parallel -q normal -N 1 -n 1 -c 1 --mem=32g --time=50:00 --pty bash

To confirm the compute node hostname:

hostname -f

Example output:

pfc030.pf.ornl.gov

Save this hostname. We will need it later.

Load Python and activate your environment:

module load miniforge3/24.11.3-0
conda create -p /path/to/my_env python=3.11
source activate /path/to/my_env

If this is your first time using the environment and Jupyter is not installed, install it once:

python -m pip install jupyterlab notebook ipykernel

Start JupyterLab on the compute node

python -m jupyter lab --no-browser --ip=0.0.0.0 --port=8889

Important:

  • Leave this terminal open
  • Do not press Ctrl+C. Jupyter must keep running while you use it

You will see output similar to:

http://pfc030.pf.ornl.gov:8889/lab?token=...
http://127.0.0.1:8889/lab?token=...

Copy the token or the full URL. You will need it to log in.

On your local laptop, create an SSH tunnel from your laptop to the login node, forwarding traffic to the compute node:

ssh -N -L 8889:pfc030.pf.ornl.gov:8889 user_id@pflogin.ornl.gov
  • Replace: pfc030.pf.ornl.gov with your actual compute node hostname from hostname -f

On your laptop, open a web browser and go to:

http://localhost:8889/lab

If prompted for a token, paste the token shown when Jupyter started.