Search code examples
gitkubernetesjupyter-notebookjupyter-lab

Kubernetes - Jupyter Notebook - Issue with jupyterlab-git extension


I have a Jupyter Notebook k8s pod. And, I have upgraded jupyterlab-git extension with the below command.

Note: the previous version is : jupyterlab-git 0.41.0

pip install --upgrade --pre jupyterlab-git

However, the git option is not showing Up on the Jupyter Notebook webpage.

Error after refreshing the Jupyter webpage:

Failed to load the jupyterlab-git server extension
The versions of the JupyterLab Git server frontend and backend do not match. The @jupyterlab/git frontend extension has version: 0.50.1 while the python package has version 0.41.0. Please install identical version of jupyterlab-git Python package and the @jupyterlab/git extension. Try running: pip install --upgrade jupyterlab-git

Command output:

    (base) root@jupyter-pyspark-notebook-0:~# jupyter server extension list
    Config dir: /home/jovyan/.jupyter
    
    Config dir: /opt/conda/etc/jupyter
        jupyter_lsp enabled
        - Validating jupyter_lsp...
    Package jupyter_lsp took 0.0150s to import
    A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
          jupyter_lsp 2.2.0 OK
        jupyter_server_mathjax enabled
        - Validating jupyter_server_mathjax...
    Package jupyter_server_mathjax took 0.0016s to import
          jupyter_server_mathjax  OK
        jupyter_server_terminals enabled
        - Validating jupyter_server_terminals...
    Package jupyter_server_terminals took 0.0079s to import
          jupyter_server_terminals 0.4.4 OK
        jupyterlab enabled
        - Validating jupyterlab...
    Package jupyterlab took 0.0755s to import
          jupyterlab 4.0.7 OK
        jupyterlab_git enabled
        - Validating jupyterlab_git...
    Package jupyterlab_git took 0.0240s to import
          jupyterlab_git 0.50.1 OK
        nbclassic enabled
        - Validating nbclassic...
    Package nbclassic took 0.0024s to import
    A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
          nbclassic 1.0.0 OK
        nbdime enabled
        - Validating nbdime...
    Package nbdime took 0.0000s to import
          nbdime 4.0.1 OK
        notebook enabled
        - Validating notebook...
    Package notebook took 0.0000s to import
          notebook 7.0.6 OK
        notebook_shim enabled
        - Validating notebook_shim...
    Package notebook_shim took 0.0000s to import
    A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
          notebook_shim  OK
    
    Config dir: /usr/local/etc/jupyter
================================================================================
(base) root@jupyter-pyspark-notebook-0:~# jupyter labextension list
JupyterLab v4.0.7
/opt/conda/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled  X (python, jupyterlab_pygments)
        nbdime-jupyterlab v3.0.1 enabled OK
        jupyter-matplotlib v0.11.3 enabled OK
        @jupyter-notebook/lab-extension v7.0.6 enabled OK
        @jupyterlab/git v0.50.1 enabled OK (python, jupyterlab-git)
        @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)


   The following extensions are outdated:
        jupyterlab_pygments

   Consider checking if an update is available for these packages.

Solution

  • Your Jupyter kernel has probably started with the pod.

    You are indeed installing the new version in the pod but you would need to restart the service in the pod where your Jupyter notebook is running. The problem is that if you restart the service within the pod it will probably restart the whole pod. And if the pod is restarted you are back to square one.

    I would rebuild/publish a new container image with the jupyterlab-git updated.

    Example Dockerfile

    FROM:<current-jupyter-image>
    
    RUN pip install --upgrade --pre jupyterlab-git
    ...