Many users will require a JupyterLab environment with packages included beyond those available in the system default python environment.

Some of those needs may be satisfied by using one of the Specialised Environments but those won't be appropriate for all users.

If you need a custom environment, here is a step-by-step guide on getting started.

You will need to substitute appropriate values where I have used the ne4 project and my userid of dmo900 throughout; you may also not want to install the environment under /g/data/$PROJECT/$USERID (for example you might want it in /scratch if it is only for short term usage, or maybe directly under /g/data/$PROJECT if it is for use project-wide rather than just for your own use). Just make sure that you are consistent between the creation of the environment, the path you pass in the "Python or Conda virtual environment base", and ensure your job has the appropriate storage option applied to be able to see that path.

Creating the venv

(testvenv) $  pip install -U pip setuptools

Requirement already satisfied: pip in /g/data/ne4/dmo900/testvenv/lib/python3.10/site-packages (22.0.4)

Collecting pip

  Downloading pip-22.2.2-py3-none-any.whl (2.0 MB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 28.8 MB/s eta 0:00:00

Requirement already satisfied: setuptools in /g/data/ne4/dmo900/testvenv/lib/python3.10/site-packages (58.1.0)

Collecting setuptools

  Downloading setuptools-65.3.0-py3-none-any.whl (1.2 MB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 37.2 MB/s eta 0:00:00

Installing collected packages: setuptools, pip

  Attempting uninstall: setuptools

    Found existing installation: setuptools 58.1.0

    Uninstalling setuptools-58.1.0:

      Successfully uninstalled setuptools-58.1.0

  Attempting uninstall: pip

    Found existing installation: pip 22.0.4

    Uninstalling pip-22.0.4:

      Successfully uninstalled pip-22.0.4

Successfully installed pip-22.2.2 setuptools-65.3.0

(testvenv) $


At this point, your venv should be ready.

Using the venv

To launch a jupyterlab session using your venv, you need to fill in a couple of extra fields in the 'advanced' section of the JupyterLab launch form, and also make sure that the job can see the storage your venv is contained in. For example:

Note the highlighted options; you must include the storage option appropriate to the location of your venv, you must specify the same python3 module you loaded when creating the venv, and you must specify the path to the venv.

Troubleshooting