Running a Jupyter notebook from this documentation within a virtual environment

Within a TRE VM:

The following code

Open a terminal within the VM and create a virtual environment with Conda

conda create -n my_virtual_environment python=3.10
conda activate my_virtual_environment

You may be prompted by conda to initialise your shell. Run

conda init bash

and restart your terminal. Run the following commands in the restarted terminal to clone this documentation repo and install dependencies

git clone ${gitea-repository-url}
cd End-User-Docs/docs/notebooks
conda create -n my_virtual_environment python=3.10
conda activate my_virtual_environment
conda install jupyterlab ipykernel
pip install -r requirements.txt
python -m ipykernel install --user --name=my_env

A Jupyter Lab environment can then be launched by running

jupyter lab

Within this environment, navigate to the example notebooks provided. When running the notebooks, ensure the python kernel is set to the name defined by the earlier python -m ipykernel install command.