HPC Grid Tutorial: How to Create a Conda Environment for Jupyter Notebook OnDemand

This tutorial shows step by step how to create a conda environment for Jupyter Notebook OnDemand.

 

1. Log in to the Grid. Start an interactive job: srun -q primary -N 1 -n 8 --mem 4G -t 10:00:00 --pty bash

 

2. After being assigned a node, run the following: ml python/3.7

 

  • Type: conda create -n myenv

 

 

  • Enter y to proceed.

 

 

3. After the environment is created, it can be activated.

 

  • Type: conda activate myenv

 

 

4. Install the packages pip and ipykernel.

 

  • Type: conda install pip ipykernel

 

 

 

 

5. Next, you can create a visible kernel for your conda environment.

 

  • Type: python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

 

 

          Now the environment will be available within Jupyter Notebook on OnDemand.