Jupyterlab-git in Jupyter Hub

I installed JupyterHub following doc here. JupyterHub and lab are working fine.

Now when I try to install jupyterlab_git it fails .

Steps followed -

  1. sudo conda install -c conda-forge jupyterlab jupyterlab-git
    as per doc

The following NEW packages will be INSTALLED:

:
jupyterlab-git conda-forge/noarch::jupyterlab-git-0.23.3-pyhd8ed1ab_0
: -
Downloading and Extracting Packages
:
jupyterlab-git-0.23. | 256 KB | ############################################################################# | 100%

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

  1. Login as lab user But did not find Git extension . Tried to enable extension from UI but failed with “Permission error” and message of pip install or conda install.

  2. As per troubleshooting guide checked

(jupyerhubenv) [ec2-user@ip-xxx home]$ jupyter server extension list
Config dir: /home/ec2-user/.jupyter

Config dir: /opt/jupyterhub/etc/jupyter
jupyterlab enabled
- Validating jupyterlab…
jupyterlab 3.0.7 OK
nbclassic enabled
- Validating nbclassic…
nbclassic OK

Config dir: /usr/local/etc/jupyter

(jupyerhubenv) [ec2-user@ip-xxxxx home]$ jupyter labextension list
JupyterLab v2.2.9
Known labextensions:
app dir: /opt/miniconda3/share/jupyter/lab
@jupyterlab/git v0.23.3 enabled OK
nbdime-jupyterlab v2.0.1 enabled OK

Build recommended, please run jupyter lab build:
nbdime-jupyterlab needs to be included in build
@jupyterlab/git needs to be included in build

  1. Trying to enable extension fails
    (jupyerhubenv) [ec2-user@ip-xxxx home]$ sudo /opt/jupyterhub/bin/jupyter serverextension enable --py jupyterlab_
    git
    Traceback (most recent call last):
    File “/opt/jupyterhub/bin/jupyter-serverextension”, line 8, in
    sys.exit(main())
    File “/opt/jupyterhub/lib64/python3.7/site-packages/jupyter_core/application.py”, line 254, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File “/opt/jupyterhub/lib64/python3.7/site-packages/traitlets/config/application.py”, line 845, in launch_instance
    app.start()
    File “/opt/jupyterhub/lib64/python3.7/site-packages/notebook/serverextensions.py”, line 291, in start
    super().start()
    File “/opt/jupyterhub/lib64/python3.7/site-packages/jupyter_core/application.py”, line 243, in start
    self.subapp.start()
    File “/opt/jupyterhub/lib64/python3.7/site-packages/notebook/serverextensions.py”, line 208, in start
    self.toggle_server_extension_python(arg)
    File “/opt/jupyterhub/lib64/python3.7/site-packages/notebook/serverextensions.py”, line 197, in toggle_server_extension_python
    m, server_exts = _get_server_extension_metadata(package)
    File “/opt/jupyterhub/lib64/python3.7/site-packages/notebook/serverextensions.py”, line 325, in _get_server_extension_metadata
    m = import_item(module)
    File “/opt/jupyterhub/lib64/python3.7/site-packages/traitlets/utils/importstring.py”, line 38, in import_item
    return import(parts[0])
    ModuleNotFoundError: No module named ‘jupyterlab_git’

  2. (jupyerhubenv) [ec2-user@ip-xxx tmp]$ sudo ls /opt/miniconda3/share/jupyter/lab/extensions/
    jupyterlab-git-0.23.3.tgz nbdime-jupyterlab-2.0.1.tgz.

I want to enable git extension for all users . Am I missing any step or making any obvious mistake.

regards,
Thomas

If I am not mistaken, then you have to install beta version of jupyterlab-git. JupyterLab3 isn’t yet fully compatible with the latest version of git extension as mentioned in this issue.
Try installing with
pip install --upgrade --pre jupyterlab-git

1 Like

Thank you for the inputs.

I tried few steps including “pip install --upgrade --pre jupyterlab-git” . Now it is working. I cannot exactly pinpoint which step (since I basically re-did everything) fixed the issue but I sure ran the above.

(jupyerhubenv) [ec2-user@ip-xxx ~]$ /opt/jupyterhub/bin/jupyter lab extension list
Config dir: /home/ec2-user/.jupyter

Config dir: /opt/jupyterhub/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.7 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.30.0b2 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK
    nbdime enabled
    - Validating nbdime...
      nbdime 3.0.0.b1 OK

Config dir: /usr/local/etc/jupyter

(jupyerhubenv) [ec2-user@ip-xxx ~]$ /opt/jupyterhub/bin/jupyter server extension list
Config dir: /home/ec2-user/.jupyter

Config dir: /opt/jupyterhub/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.7 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.30.0b2 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK
    nbdime enabled
    - Validating nbdime...
      nbdime 3.0.0.b1 OK

Config dir: /usr/local/etc/jupyter

Only issue now is that in the lab UI it keeps giving “nbdime-jupyterlab” needs to be included in build.

If I do clean and re-build it still gives shows “nbdime-jupyterlab” needs to be included in build.

Thanks