Puget Systems print logo

https://www.pugetsystems.com

Read this article at https://www.pugetsystems.com/guides/1828
Dr Donald Kinghorn (Scientific Computing Advisor )

Note: How To Install JupyterLab Extensions (Globally for a JupyterHub Server)

Written on July 15, 2020 by Dr Donald Kinghorn
Share:

Introduction

The current JupyterHub version 2.5.1 does not allow user installed extension for JupyterLab when it is being served from JupyterHub. This should be remedied in version 3. However, even when this is "fixed" it is still useful to be able to install extensions globally for all users on a multi-user system. This is especially true if JupyterHub is serving JupyterLab to a controlled group of users. For example, a class of students, workshop attendees, or a work group that is trying to maintain a consistent development environment.

Here are the steps to add a JupyterLab extension for all users when JupyterLab is served from JupyterHub.

How to Install JupyterLab Extensions for all Users on a JupyterHub Server

Find extensions. You can search on GitHub for "JupyterLab extensions". You can also use the "Extension panel" in the JupyterLab interface to find a link to an extension npm page. (After version 3 is released users should be able to install "personal" extensions from there. )

JupyterLab Extensions panel


I'll be installing the drawio Diagraming extension ( [https://github.com/QuantStack/jupyterlab-drawio](https://github.com/QuantStack/jupyterlab-drawio) )


First sudo to a root shell (I'm using the terminal in JupyterLab),

(base) kinghorn@pslabs-ml1:~$ sudo -s
[sudo] password for kinghorn: 
root@pslabs-ml1:/home/kinghorn# 

Then activate the conda env for your JupyterHub/Lab (you may have to source conda.sh profile since root does not source that automatically) I have JupyterHun/Lab installed in the env "jupyterhub"

root@pslabs-ml1:/home/kinghorn# source /etc/profile.d/conda.sh 

root@pslabs-ml1:/home/kinghorn# conda activate jupyterhub
(jupyterhub) root@pslabs-ml1:/home/kinghorn# 

Now you can install the extension from the command-line,

(jupyterhub) root@pslabs-ml1:/home/kinghorn# jupyter labextension install jupyterlab-drawio
Building jupyterlab assets (build:prod:minimize)

Reload the browser page and the extension should be ready for use. It will be available for all JupyterHub users on the system.

There will now be an icon for drawio on the "Launcher" page "Other" section in JupyterLab. ...Ready for you flow-charting and diagraming pleasure!

drawio icon

Happy computing! --dbk @dbkinghorn -- Best wishes and stay safe!


Looking for a GPU Accelerated Workstation?

Puget Systems offers a range of poweful and reliable systems that are tailor-made for your unique workflow.

Configure a System!

Labs Consultation Service

Our Labs team is available to provide in-depth hardware recommendations based on your workflow.

Find Out More!

Why Choose Puget Systems?


Built specifically for you

Rather than getting a generic workstation, our systems are designed around your unique workflow and are optimized for the work you do every day.

Fast Build Times

By keeping inventory of our most popular parts, and maintaining a short supply line to parts we need, we are able to offer an industry leading ship time of 7-10 business days on nearly all our system orders.

We're Here, Give Us a Call!

We make sure our representatives are as accessible as possible, by phone and email. At Puget Systems, you can actually talk to a real person!

Lifetime Support/Labor Warranty

Even when your parts warranty expires, we continue to answer your questions and even fix your computer with no labor costs.

Click here for even more reasons!

Puget Systems Hardware Partners

Tags: JupyterLab, JupyterHub, Jupyter notebook, Notes