Installing extension at user level

Extensions — JupyterLab 3.4.3 documentation and Extensions — JupyterLab 4.0.0a26 documentation both suggest that there’s a --level user option that can be used to install extensions as a user:

When using the command line, you can target the --level of the config: user, system, or sys-prefix (default).

However it is entirely unclear where this flag is supposed to go. jupyter --level user labextension install my-extension, jupyter labextension --level user install my-extension, and jupyter labextension install --level user my-extension all complain about not knowing about a “level” alias (or jupyter-user not being a valid (sub)command).

Are the docs outdated? Am I missing something somewhere?

> jupyter --version
Selected Jupyter core packages...
IPython          : 8.4.0
ipykernel        : 6.15.1
ipywidgets       : 7.7.1
jupyter_client   : 7.3.4
jupyter_core     : 4.11.1
jupyter_server   : 1.18.1
jupyterlab       : 3.4.4
nbclient         : 0.6.6
nbconvert        : 6.5.0
nbformat         : 5.4.0
notebook         : 6.4.12
qtconsole        : not installed
traitlets        : 5.3.0

Those are only in the enabling/disabling of already installed, built-in extensions in $PREFIX/share/jupyter/lab/static or pre-built extensions $PREFIX/share/jupyter/labextensions

jupyter labextension enable --level=user my-extension
jupyter labextension disable --level=user my-extension

Non-developer use of jupyter labextension install (or even jupyter lab build) invokes the whole nodejs-based machinery, and can incur additional complexity while reducing the predictability of the final system, especially over time.

Ideally, all extensions would be provided by pip (or conda or whatever) packages, and installed into $PREFIX/share/jupyter/labextensions which helps ensure the frontend, and any backend, versions all match correctly, and can be managed/upgraded by a single requirements.txt or environment.yml, as a prelude to being locked for reproducibility by pip-tools or conda-lock.

There are some additional features for finding pre-built extensions in more places, as controlled by jupyter --paths, which can be extended by environment variables or by the LabApp.labextensions_path, but again, this can increase the unpredictability of the installation.