I am just a user of our University’s Open OnDemand and trying to run a custom JupyterLab installed using Spack.
I simply use the following script in the Jupyter Notebook application with OOD, and launch a jupyterlab session:
#!/bin/bash
# load custom module system
. /work/comphyd_lab/local/modules/spack/2024v5/lmod-init-bash
ml unuse $MODULEPATH
ml use /work/comphyd_lab/local/modules/spack/2024v5/modules/linux-rocky8-x86_64/Core/
ml load py-jupyterlab
ml load node-js
ml load py-terminado
ml load py-pip
# As per https://rcs.ucalgary.ca/index.php/Jupyter_Notebooks
unset XDG_RUNTIME_DIR
# make the NotebookApp values into ServerApp for JupyterLab
sed -i 's/NotebookApp/ServerApp/g' "${CONFIG_FILE}"
sed -i 's/notebook_dir/root_dir/g' "${CONFIG_FILE}"
# Launch the Jupyter Notebook Server
set -x
jupyter lab --config="${CONFIG_FILE}"
I also have the jupyterlmod
extension installed. When I try to load/unload my modules, the $PYTHONPATH
environment remains unchanged, but $PATH
on other variables change without any issues. The default $PYTHONPATH
lists all the values that I had to load once for launching my JupyterLab session.
Why jupyterlmod
cannot update $PYTHONPATH
variable?