Installing an nbextension via pip "require? x (file name)"

Hi all,

I’d like to install the jupyterlab_vim extension, and have been quite confused about how nbextensions are installed, apparently. It seems that much of the existing advice online has changed after the syntax moved from “jupyter contrib nbextension” to “jupyter nbextension” etc. Also google search results almost exclusively turn up guides on installing this omnibus-style jupyter_contrib_nbextensions package. I just want jupyterlab_vim. So apologies if this is something basic that appears in the documentation, but it’s been impossible to find for me.

I have used the following approach, using python 3.11, jupyter notebook 6.5.4:

pip install --user jupyterlab-vim
jupyter nbextension install --user /home/gavin/.local/lib/python3.11/site-packages/jupyterlab_vim

The output from this looks promising (I had re-ran this hence the “up-to-date” messages):

gpad% jupyter nbextension install /home/gavin/.local/lib/python3.11/site-packages/jupyterlab_vim --user
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/_version.py
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/__init__.py
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/__pycache__/__init__.cpython-311.pyc
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/__pycache__/_version.cpython-311.pyc
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/package.json
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/schemas/@axlair/jupyterlab_vim/plugin.json
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/schemas/@axlair/jupyterlab_vim/package.json.orig
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/static/830.29023cea9c147059457e.js
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/static/remoteEntry.383e80b88deea45d9495.js
Up to date: /home/gavin/.local/share/jupyter/nbextensions/jupyterlab_vim/labextension/static/style.js

    To initialize this nbextension in the browser every time the notebook (or other app) loads:

          jupyter nbextension enable <the entry point> --user

But then when I try to enable my extension, I see:

gpad% jupyter nbextension enable jupyterlab_vim
Enabling notebook extension jupyterlab_vim...
      - Validating: problems found:
        - require?  X jupyterlab_vim
gpad% jupyter nbextension enable --user jupyterlab_vim
Enabling notebook extension jupyterlab_vim...
      - Validating: problems found:
        - require?  X jupyterlab_vim
gpad% jupyter nbextension enable --user /home/gavin/.local/lib/python3.11/site-packages/jupyterlab_vim
Enabling notebook extension /home/gavin/.local/lib/python3.11/site-packages/jupyterlab_vim...
      - Validating: problems found:
        - require?  X /home/gavin/.local/lib/python3.11/site-packages/jupyterlab_vim

The error message here is really not helpful. A plain old x next to a file that certainly exists on my system is not helping me at all.

If anyone can provide some guidance on getting this nbextension working, I would be enormously thankful!

Hi

As you probably know there are primarily 2 distinct notebook engines, ‘classic’ notebook and ‘jupyterlab’

Their extension systems are distinct as well, and so you cannot manage a (jupyter)lab extension - it’s obviously your case - with jupyter nbextension that is dedicated to classic extensions

I think you need to use jupyter labextension instead to list, enable, and more generally manage your lab extensions (that being said I can see no mention of enabling this extension here)

now if you really want to use classic, then this extension won’t help you as it targets lab.