jupyter_nbextensions_configurator icon indicating copy to clipboard operation
jupyter_nbextensions_configurator copied to clipboard

Configurator doesn't load under Jupyter Lab 3 + nbclassic

Open jeffyjefflabs opened this issue 4 years ago • 16 comments
trafficstars

This is perhaps an obscure use case, but... if you are using Jupyter Lab 3 (which uses the new jupyter_server backend instead of the notebook backend), then go to Help -> Launch Classic Notebook, this will launch the new nbclassic extension, which in turn loads the configurator via a compatibility layer.

It looks like the problem is here where the configurator adds an additional nbextension path -- under nbclassic, that settings dict doesn't have key nbextensions_path, so it throws an exception and the rest of the loader function doesn't run.

I don't know what the best way to fix it is, but as a workaround you can delete those two lines and run jupyter nbextension install jupyter_nbextensions_configurator --py, which will put the extension files in one of the default locations.

jeffyjefflabs avatar Jan 05 '21 23:01 jeffyjefflabs

it doesn't load for me in jupyter notebook either. I'm doing a clean install of anaconda (today), into a clean environment. But I get nothing. And when I try to install an extension in sys-prefix or --user the enable fails on require? X .

cems2 avatar Jan 06 '21 17:01 cems2

If it's not loading in classic notebook, that's probably #125 and #126. I patched render.js as described in #125 to fix that, but this is another problem that (I think) only happens if you launch via Lab.

jeffyjefflabs avatar Jan 06 '21 17:01 jeffyjefflabs

I can confirm the problem on Jupiter Labs 3.0.9 and that @jeffyjefflabs patch works.

There is a previous warning that says jupyter_nbextensions_configurator | extension was found and enabled by nbclassic. Consider moving the extension to Jupyter Server's extension paths which probably is the "proper" way to fix it, but not sure how to do that.

AronT-TLV avatar Mar 09 '21 09:03 AronT-TLV

What is an end-user supposed to do to get the configurator running under Lab?

NikosAlexandris avatar Jul 13 '21 07:07 NikosAlexandris

There's a fix currently in the works here: https://github.com/jupyterlab/nbclassic/pull/63

Thank you, everyone, for your patience here.

If anyone is willing to test out this PR in nbclassic to verify that it fixes the issue, that would be greatly appreciated!

Zsailer avatar Oct 08 '21 17:10 Zsailer

nbclassic 0.3.3 should solve this issue. Upgrade nbclassic with pip install -U nbclassic and the nbextensions_configurator page should work again with latest JupyterLab

Zsailer avatar Oct 22 '21 20:10 Zsailer

The same thing occurred when I upgraded from python3.8 to python3.9 with conda envs yesterday. I remembered that it happened when I upgraded from python3.6 to python3.8 with conda envs before(but maybe it was fixed later),too. 1ED5519374CFCA8CD813C9657160E396 E02A426B92F5F139E9D56EABC688FB3D A9551C46F0AF59C457BD2EB0F539FF8D

Reproduce: 1 install using conda create -n jupyterpy39demo python=3.9 and then activate it,and doing the following after that, pip install jupyterlab notebook jupyter_nbextensions_configurator jupyter_contrib_nbextensions jupyter contrib nbextension install jupyter nbextensions_configurator enable 2 launch the lab,go to nbclassic,you will see it.

Envs: win 10/2019, jupyterlab 3.4.2 ,notebook 6.4.11, nbclassic 0.3.7, jupyter_nbextensions_configurator 0.4.1, jupyter_contrib_nbextensions-0.5.1 ... and there were some other envs in my computer.

DatumWorld avatar May 25 '22 02:05 DatumWorld

@DatumWorld, do you mind sharing the output of:

jupyter server extension list

Zsailer avatar May 25 '22 15:05 Zsailer

@DatumWorld, do you mind sharing the output of:

jupyter server extension list

image There are files in the folder image Strangely,while switch to another envs(named jupyterpy38 with python3.8 and conda),it is fine as shown in the following picture image The output of the jupyterpy38 envs CE47A4B676636D0D4C6E269C7A36D0EE

DatumWorld avatar May 26 '22 07:05 DatumWorld

@Zsailer @DatumWorld Just ran into it myself, are there any updates or a workaround? thanks!

obarak avatar Aug 09 '22 17:08 obarak

Same problem with Python 3.10 and latest jupyter docker-stacks spark-3.3.0, any fix? Thanks

doctapp avatar Oct 17 '22 18:10 doctapp

Was experiencing the same issue but it was resolved by applying the patch in: https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator/pull/141 and then running:

$ pip install jupyter_nbextensions_configurator
$ jupyter nbextension install --sys-prefix --py jupyter_nbextensions_configurator --overwrite
$ jupyter nbextension enable --sys-prefix --py jupyter_nbextensions_configurator
$ jupyter serverextension enable --sys-prefix --py jupyter_nbextensions_configurator

dleen avatar Nov 03 '22 00:11 dleen

The patch from #141 seems to fail to work - empty /nbextensions can appear just as they did previously. I tried to install the configurator from master branch at Github (as compared with the standard pip install, because the patch is not released to PyPI yet).

However, I've found a workaround - it is to start Notebook directly (jupyter notebook), rather than indirectly through the Lab (started with jupyter lab). Starting first Lab and only then Jupyter, via Lab's Help menu option makes configurator disappear (its page becomes empty, but with header and a link to "Nbextensions configuration ([more information](<NB_URL>/nbextensions/nbextensions_configurator/rendermd/nbextensions/nbextensions_configurator/readme.md))", rather than raising 404 error).

I verified this with the latest Jupyter core packages versions:

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.7.0
ipykernel        : 6.19.4
ipywidgets       : 8.0.4
jupyter_client   : 7.4.8
jupyter_core     : 5.1.1
jupyter_server   : 2.0.6
jupyterlab       : 3.5.2
nbclient         : 0.7.2
nbconvert        : 7.2.7
nbformat         : 5.7.1
notebook         : 6.5.2
qtconsole        : not installed
traitlets        : 5.8.0

mirekphd avatar Jan 01 '23 15:01 mirekphd

Related SO issue: https://stackoverflow.com/questions/68208833/jupyter-lab-does-not-load-jupyter-nbextensions-configurator-but-jupyter-noteboo

mirekphd avatar Jan 01 '23 18:01 mirekphd

The configurator adds itself to the nbextensions_path settings when it is being loaded (i.e. juypter lab / notebook is started). This is how the configurator finds it's resources. Starting the notebook using the help menu seems to ignore this setting. A workaround would be to manually copy the required nbextensions_configurator directory (located under jupyter_nbextensions_configurator/static/nbextensions_configurator) to the place where the other notebook extensions are located.

juhasch avatar Jan 03 '23 13:01 juhasch

Was experiencing the same issue but it was resolved by applying the patch in: #141 and then running:

$ pip install jupyter_nbextensions_configurator
$ jupyter nbextension install --sys-prefix --py jupyter_nbextensions_configurator --overwrite
$ jupyter nbextension enable --sys-prefix --py jupyter_nbextensions_configurator
$ jupyter serverextension enable --sys-prefix --py jupyter_nbextensions_configurator

This is really helpfull , thank u so much

GraceSevillano avatar Feb 17 '23 14:02 GraceSevillano