Jupyterlab + Notebook + nbextensions

Hi, not sure if I’m understanding it correctly, but when I install jupyterlab, do I loose nbextensions? When I open classical notebook <url>/tree no extention works.

I’m planing to teach my full class using jupyter. Rise is essential, such as others extentions…
On the other hand, integrated drawio of jupyterlab makes an awesome blackboard. Would be good to have both…

The problem is that, when I install jupyterlab, all my nbextensions (rise as well) vanish.
In order to solve this problem, I created two virtualenv, one for lab and other for notebook.

Is this the correct approach? Besides, I have to close one in order to open another. Not a good live workflow.

1 Like

Your nbextensions should still work with the classic notebook. Just a few follow-up questions to see is we can diagnose the issue:

  1. What version of jupyterlab are you running, jupyter lab --version ?
  2. If you’re running JupyterLab > 3.0,
    1. what do you get when you list your server extensions, jupyter server extension list?
    2. What do you get when you run jupyter nbextension list?
    3. What version of nbclassic do you have: python -c "from nbclassic.__version__ import __version__; print(__version__)"?

I just verified that in the latest JupyterLab + RISE, I can switch between classic notebook with RISE and JupyterLab by switching endpoints. My guess is there might be a mismatch in versions. If so, we’ll need to make some changes in these projects to make sure the correct version is picked up.

Thanks for the help @Zsailer.

$ jupyter lab --version
3.1.14

$ jupyter server extension list
Config dir: /home/thales/Programas/Jupyter/config/

Config dir: /home/thales/External/Programas/Jupyter/env_jupyterlab/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.1.14 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK

Config dir: /usr/local/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.1.14 OK

$ jupyter nbextension list
Known nbextensions:
  config dir: /home/thales/Programas/Jupyter/config/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      egal/main  enabled 
      - Validating: problems found:
        - require?  X egal/main
      code_prettify/code_prettify  enabled 
      - Validating: OK
      collapsible_headings/main  enabled 
      - Validating: OK
      equation-numbering/main  enabled 
      - Validating: OK
      hide_input_all/main  enabled 
      - Validating: OK
      spellchecker/main  enabled 
      - Validating: OK
      toggle_all_line_numbers/main  enabled 
      - Validating: OK
      scratchpad/main  enabled 
      - Validating: OK
      varInspector/main  enabled 
      - Validating: OK
      highlight_selected_word/main  enabled 
      - Validating: OK
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

$ python -c "from nbclassic.__version__ import __version__; print(__version__)"
0.3.2

How did you install RISE? Are you sure its installed?

When I list nbextensions, I see this:

  config dir: /<sys-prefix>/etc/jupyter/nbconfig
    notebook section
      rise/main  enabled
      - Validating: OK

but I’m not seeing this in your output, which suggests that this isn’t a JupyterLab issue, but maybe an installation issue?

1 Like

Ok, probably I could mess something up…

With a fresh install I get the same problem. Please, check full log:

[W 2021-09-30 16:17:33.493 ServerApp] 404 GET /nbextensions/nbextensions_configurator/list?_=1633029452869 (192.168.200.78) 17.10ms referer=http://elementarydesktopcasa:8888/tree

Keeps spinning forever…

I can’t edit extensions, I have to do it using cli or using another virtualenv that can further be applied here.

Ok, looks like RISE should be working in that environment you just created.

The issue with the other extension configurator is a (known) bug: jupyter_nbextensions_configurator doesn't work under nbclassic · Issue #46 · jupyterlab/nbclassic · GitHub

Funny enough, I submitted a patch in June to address this issue: Expose classic notebook's static assets from their original endpoints by Zsailer · Pull Request #63 · jupyterlab/nbclassic · GitHub

I completely forgot about it, ha! :man_facepalming: Even worse, I don’t even remember creating this PR. :sweat_smile:

I’ll work on getting tests passing, merge this PR, and cut a release ASAP.

1 Like

:rofl:

I confirm that RISE work, however I need the extension configurator to get it working.

I really appreciate it.

There was some additional (fairly subtle) changes needed to get nbextensions_configurator working. This exposed a deeper issue with how tornado handles routes+handlers added before/after the instantiation of the web application. I believe I’ve fixed these issues. I’m just waiting on review of that pull request before merging.

In the meantime, @thalesmaoa, it would be great if you can try out this PR and verify that enables you to use nbextensions_configurator with the latest jupyterlab. I was able to confirm this locally, but it would be great to get a second tester to try it out.

Sure I can, however I’m not familiar with the development flow. Where can I find your code? I’ve looked over your repository of nbclassic, but not sure if this is it, which branch and how to install it.

@thalesmaoa, the PR was actually merged today, so you should be able to clone nbclassic (GitHub - jupyterlab/nbclassic: Jupyter Notebook as a Jupyter Server extension) directly and try it out. If that works, I can cut a release on early next week.

2 Likes

@Zsailer, I’m sorry. I’m really late. I tested and everything worked as expected. I will update as soon the next release. Thank you.

@Zsailer, I’m not sure if this is related. Using nbclassic I can’t get my images to display.

However, It does show using Jupyterlab

Hi @Zsailer, I really could find the source of the problem. Image is not shown in nbclassic

<img src="fig/banner.jpg" width="50%" />