20

Is it possible to use notebook extensions (nbextensions) within Jupyter Lab?

I think my extensions are enabled... I call jupyter nbextension enable on them beforehand. But I don't see them in notebooks from within Jupyter Lab.

william_grisaitis
  • 5,170
  • 3
  • 33
  • 40
  • 4
    @grisatis, Jupyter nbextensions are not compatible with Jupyterlab - the notebook extensions relied too much on globals and injecting inline JS. Jupyterlab, on the other hand, has a well documented [extension API](https://jupyterlab.readthedocs.io/en/stable/user/extensions.html). I'm not sure what extensions you are looking for, but you can search for the github topic [jupyterlab-extension](https://github.com/topics/jupyterlab-extension) – madhu94 Nov 11 '18 at 16:16

1 Answers1

22

No, it is not possible to use a Notebook Classic extension in JupyterLab.

Though a great deal of effort has been made to make the notebook UI in JupyterLab look and feel like the UI in Notebook Classic, on the backend they do not share a code base. Thus, nbextensions for Notebook Classic have zero fundamental compatibility with JupyterLab. Beyond that, as @madhu94 points out, the extension API (how extensions should be structured, required methods, etc) are completely different in Classic and Lab.

There are some examples of projects with both an nbextension for Notebook Classic and a labextension for JupyterLab (eg jupyter-widgets/ipywidgets). In these cases the project will have separate code for each kind of extension.

tel
  • 13,005
  • 2
  • 44
  • 62
  • do you recommend using jupyerlab or jupyter notebook? They are very similar but very different at the same time...... – Luk Aron Feb 19 '21 at 21:14
  • 1
    @LukAron As a former power user and current developer of all things Juptyer, I would strongly recommend that you use JupyterLab. You can do everything in JupyterLab that you could do in NB Classic. And a whole lot more, but you don't have to; engaging with the extra functionality in JupyterLab is entirely optional – tel Mar 02 '21 at 22:32
  • 1
    @LukAron And if there is something that you could do in NB Classic that you can't in JupyterLab, please file an issue [here](https://github.com/jupyterlab/jupyterlab/issues). We consider gaps in parity/functionality between jlab and classic to be bugs – tel Mar 02 '21 at 22:33
  • @tel, what is JupyterLab's extension/widget similar to Jupyter Notebook's [python-markdown](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/python-markdown) extension? – Oo'- Mar 17 '21 at 03:46
  • @GustavoReis that's off topic for this thread. Your best bet for getting good answers to similar questions would be https://discourse.jupyter.org/ – tel Mar 29 '21 at 21:24
  • This list: https://jupyterlab-contrib.github.io/migrate_from_classical.html contains labextension equivalents, or alternatives, to popular nbextensions. – Daniel Goldfarb Mar 27 '23 at 20:38