Unable to get jupyterlab-git extension working

We are currently in the process of automating AWS EC2 image builds that have TLJH installed along with some basic extensions. I’m using an Ansible playbook to handle the TLJH installation. When the EC2 instance is launched, we have a path specified in our load balancer to redirect to the hub server on there.

I am able to successfully access JupyterLab via our URL and it works fine. However, I am unable to see the JupyterLab-Git panel in the UI. I have even tried manually installing the extension in the EC2 shell; it shows up in the server and lab extension lists but does not show up in the UI even after reloading tljh. Unfortunately, I’ve been down this rabbit hole for two whole days with nothing to show for it, except a ton of frustration.

I really need someone to lay out the exact commands (including venv activation) required to successfully install extensions and have their corresponding UI elements show up in JupyterLab after reloading/respawning the user’s server.

Thanks in advance…

First thing to check is what are the outputs of

jupyter server extension list

and

jupyter labextension list

also, worth checkig if the version of jupyterlab-git and jupyterlab are compatible

1 Like

Server extension list:

Config dir: /root/.jupyter

Config dir: /opt/tljh/hub/etc/jupyter
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.5 OK
    jupyter_server_mathjax enabled
    - Validating jupyter_server_mathjax...
      jupyter_server_mathjax  OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.3 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 4.1.6 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.50.0 OK
    nbdime enabled
    - Validating nbdime...
      nbdime 4.0.1 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK

Config dir: /usr/local/etc/jupyter

Lab extension list:

JupyterLab v4.1.6
/opt/tljh/hub/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        nbdime-jupyterlab v3.0.1 enabled OK
        @jupyterlab/git v0.50.0 enabled OK (python, jupyterlab-git)

The extension needs to be installed in the user environment, not the hub environment.

2 Likes

The extension needs to be installed in the user environment, not the hub environment.

Are you referring to activating the /opt/tljh/user venv prior to installation? If so, I have already tried that and it still will not show up when relaunching the server.

FWIW, I did a vanilla install of JupyterLab on an Ubuntu container via pip install jupyterlab, installed the extension via pip install jupyterlab-git and the corresponding UI panel showed up on the first try. This would lead me to believe that there is an underlying issue in trying to get this working successfully on TLJH.

1 Like

I’ve just deployed a new Ubuntu 22.04 VM, installed TLJH following

Installed jupyterlab-git from an admin terminal

sudo -E mamba install jupyterlab-git

and it’s working fine for me, for admin and non-admin users:

I’ve also verified that installing with pip works in an admin terminal sudo -E pip install jupyterlab-git

1 Like

@manics - Thanks. However, I would like to install extensions outside of the IDE since we’re creating EC2 instances via Packer/Ansible and need TLJH, along with the extensions, installed when building the image.

Please let me know the commands to successfully install extensions at the OS level.

The extension needs to be installed in the user environment, not the hub environment.

This turned out to be the key component. I don’t know why the manual install to user venv wasn’t working but through Ansible the extension installed and rendered successfully.

1 Like

Unfortunately we’re back to this not working again. This is on an AWS EC2 running Ubuntu 22.04. Here is the output of the extensions list from within the terminal:

jupyter-6c9a7085-c87a-412c-afba4@ip-10-74-41-147:~$ jupyter server extension list
Config dir: /home/jupyter-6c9a7085-c87a-412c-afba4/.jupyter

Config dir: /opt/tljh/user/etc/jupyter
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.5 OK
    jupyter_resource_usage enabled
    - Validating jupyter_resource_usage...
      jupyter_resource_usage 1.0.2 OK
    jupyter_server_mathjax enabled
    - Validating jupyter_server_mathjax...
      jupyter_server_mathjax  OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.3 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 4.2.0 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.50.1 OK
    nbdime enabled
    - Validating nbdime...
      nbdime 4.0.1 OK
    nbgitpuller enabled
    - Validating nbgitpuller...
      nbgitpuller 1.2.1 OK
    notebook enabled
    - Validating notebook...
      notebook 7.2.0 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK

Config dir: /usr/local/etc/jupyter

jupyter-6c9a7085-c87a-412c-afba4@ip-10-74-41-147:~$ jupyter labextension list
`sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`
JupyterLab v4.2.0
/opt/tljh/user/share/jupyter/labextensions
        nbdime-jupyterlab v3.0.1 enabled OK
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        @jupyter-server/resource-usage v1.0.2 enabled OK (python, jupyter-resource-usage)
        @jupyter-widgets/jupyterlab-manager v5.0.10 enabled OK (python, jupyterlab_widgets)
        @jupyter-notebook/lab-extension v7.2.0 enabled OK
        @jupyterlab/git v0.50.1 enabled OK (python, jupyterlab-git)

To me, it looks like the extension is installed and enabled in server and user, but not rendering in the UI. I really do not understand what I am missing.

It sounds like you managed to get it working before- what’s changed in your Ansible?

1 Like