21

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.

1
  • 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. I'm not sure what extensions you are looking for, but you can search for the github topic jupyterlab-extension
    – madhu94
    Commented Nov 11, 2018 at 16:16

1 Answer 1

24

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.

6
  • do you recommend using jupyerlab or jupyter notebook? They are very similar but very different at the same time......
    – Luk Aron
    Commented Feb 19, 2021 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
    Commented Mar 2, 2021 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. We consider gaps in parity/functionality between jlab and classic to be bugs
    – tel
    Commented Mar 2, 2021 at 22:33
  • @tel, what is JupyterLab's extension/widget similar to Jupyter Notebook's python-markdown extension?
    – Oo'-
    Commented Mar 17, 2021 at 3:46
  • @GustavoReis that's off topic for this thread. Your best bet for getting good answers to similar questions would be discourse.jupyter.org
    – tel
    Commented Mar 29, 2021 at 21:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.