Location of libraries or extensions installed in JupyterLab

%pip and %conda will always install in the same environment as the kernel that’s running. If that is the same environment as jupyterlab, the static files will be available when next loaded.

The shell !pip will install… wherever. It’s a bit hard to say, as it depends on how the kernel was installed, launched, etc.

No special handling exists to move files between python environments on different hosts, though “static files hosted by a kernel” have been long desired, and have lead some communities like julia to implement a “files-over-comms” approach (similar to how ipywidgets work).

Extensions that have a serverextension component would be particularly inconvenient, as these always require a server restart.

For static files in $PREFIX/share/jupyter/labextensions, it would theoretically be possible to create a jupyterlab_server_remoteextensions that allowed for making these part of the same virtual file tree, but is unlikely to land in core.

jupyterlab is designed to be less “hot swappable” in a running app than classic notebook, and doesn’t have a require.js-equivalent, and tools like jupyterlab-plugin-playground are needed to overcome some of this. It’s possible a future version will allow more dynamic plugin registration and de-registration, but this has many properties of a package manager.

4 Likes