Skip to main content

Jupyter Lmod/Tmod

Jupyter interactive notebook server extension that allows user to interact with environment modules (Lmod or Tmod) before launching kernels. The extension use environment module's Python interface to accomplish module related task like loading, unloading, saving collection, etc.

requirements

Note that the extension supports Tmod < 5.0 too. However, if MODULES_RUN_QUARANTINE is not empty on the platform, module's Python API does not have correct behaviour. On default installations, MODULES_RUN_QUARANTINE=LD_LIBRARY_PATH is used. If LD_LIBRARY_PATH is not empty before loading a module, the existant paths in LD_LIBRARY_PATH is lost after loading the module. More discussion can be found here.

If jupyter-server-proxy and jupyterlab-server-proxy are detected, jupyter-lmod will add the proxy server launchers to JupyterLab UI when modules with matching names are loaded.

setup

install

pip install jupyterlmod

Disable jupyter-server-proxy notebook and lab extensions

To avoid having items in the launcher that cannot be launched because the binaries location are not in PATH, jupyter-lmod hides launcher items that do not have a corresponding loaded module. jupyter-server-proxy notebook and lab extension always display the launcher item. To avoid a situation where an item would be shown twice, we recommend disabling jupyter-server-proxy notebook and lab extensions.

This can be done with the following command for notebook:

jupyter nbextension disable --py jupyter_server_proxy --sys-prefix

and with the following commands for jupyterlab:

jupyter labextension disable @jupyterlab/server-proxy
jupyter labextension disable jupyterlab-server-proxy

Pinning launcher items

If server proxies do not have a corresponding modules, or you wish to have their launcher items displayed regardless of the loaded modules, you can define a list of items that will be pinned in the Jupyter notebook configuration file, like this:

c.Lmod.launcher_pins = ['Desktop', 'RStudio']

or

c.Tmod.launcher_pins = ['Desktop', 'RStudio']

based on your module system.

Mapping launcher items to modules

If the name of the server proxies do not match a corresponding module, or you wish to have multiple launchers for a single module, you can define a map of server proxies to module names in the Jupyter notebook configuration file, like this:

c.Lmod.launcher_module_map = {'RStudio': ['rstudio-server'], 'paraview': ['paraview-client', 'paraview/5.13']}

or

c.Tmod.launcher_module_map = {'RStudio': ['rstudio-server'], 'paraview': ['paraview-client', 'paraview/5.13']}

based on your module system.

JupyterHub and loading module that add kernels

If you have modules that modify JUPYTER_PATH and you access Jupyter through JupyterHub, make sure that c.Spawner.disable_user_config = False.

When disable_user_config = True, JupyterHub single-user server monkey-patches the jupyter_core.jupyter_path function to remove any path related to home. In order to do that, they retrieve the value of JUPYTER_PATH, remove any paths related to home, then keep it in a global variable. The jupyter_path function is then patched to only return versions of the global variable, making the function no longer affected by changer to JUPYTER_PATH.

The JupyterHub monkey-patching of jupyter_path can be read here.

demo

Jupyter notebook demo

JupyterLab demo

develop

requirements

  • pip >= 23
  • build
  • nodejs >= 18.x

build

  • wheel and tarball:
    pyproject-build
    
  • labextension
    npm install
    npm run build
    # To install extension in jupyterlab in develop mode:
    npm run install:extension
    

Metadata

Release files for jupyterlmod 5.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterlmod 5.3.2
File Size Uploaded Provenance Actions
jupyterlmod-5.3.2.tar.gz 254.5 kB Without provenance Details for jupyterlmod-5.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlmod 5.3.2
File Interpreter ABI Platform Actions
jupyterlmod-5.3.2-py3-none-any.whl Python 3 none any Details for jupyterlmod-5.3.2-py3-none-any.whl

Total release size: 569.7 kB

Release files / jupyterlmod-5.3.2.tar.gz

Download URL jupyterlmod-5.3.2.tar.gz
Size 254.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9a6ce58e137ef3482e38cd069631b891b89ff849180582cd428a7c8ba406a1e4
BLAKE2b-256 checksum
How to use checksums
dc4cef4fde636a5263ac721b32ac3c028502f364321d7d8073177ccc19f6cf08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / jupyterlmod-5.3.2-py3-none-any.whl

Download URL jupyterlmod-5.3.2-py3-none-any.whl
Size 315.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a940c733235e734a2c5267a43aece65b10e5c047cd9a5f0e55c00b433a00381
BLAKE2b-256 checksum
How to use checksums
0eea02043c1319e40587790455c5ec2db66a92c4198a5042fdb3c8c612266b97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for jupyterlmod 5.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

5.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page