`Error: No provider for: jupyter.extensions.jupyterWidgetRegistry` after locally installing a custom labextension

I have been attempting to migrate a custom labextension which adds a new option to the help tab in the JupyterLab interface that worked before in jupyterlab=2. On its own, the labextension works properly in jupyterlab=3 and I see it functioning in the help tab and with jupyter labextension list (image in next post because I can only embed 1 image per post)

The labextension is installed locally through the postBuild of a repo2docker compatible environment. However, none of the other installed extensions work properly now. The web console shows errors like the following;

I found a similar issue on the forums and it mentions the possibility dependency duplication, but I don’t really understand the concept nor how to fix it. If anyone has any ideas about how to fix this “No provider for: jupyter.extensions.jupyterWidgetRegistry” error, that would be greatly appreciated.

The source code for the labextension is available here, and the documentation I referenced but was unable to link to about dependency duplication is here. Finally, the output for jupyter labextension list is the following, where labextension-libretexts-faq is the custom extension;

Probably your installed extensions don’t have this setting in their package.json:
"sharedPackages": { "@jupyter-widgets/base": { "bundled": false, "singleton": true } }.
I think btw, that this setting should be enabled by default for all extensions. What do you think about it, @jasongrout ?

Thank you for the reply, I think this is a good suggestion. I tried looking for that code in widgets that I have installed and most of them do not have it, but even those such as ipycytoscape which do have that code also give errors in my JupyterLab;

I will try to build my custom extension with those sharedPackages setting and see what happens.

Yes, unfortunately this did not fix my error. I updated package.json for my custom extension and all the same errors for extensions simply installed through conda are still present.

I don’t think we should special-case one specific external extension like the ipywidgets extension, but rather I think we should have a level playing field for all external extensions and help educate extension authors in what is needed. Otherwise you have a confusing situation where some external extensions need extra configuration, but others don’t, and it’s not clear what to do.

It looks like your extension has nothing to do with Jupyter Widgets, so there is no need for that extra jupyter widgets configuration in your extension.

It looks like the errors in your last image are very different than the errors in your first image. Your last image indicates a mismatch between the python version of ipycytoscape and the jlab extension for ipycytoscape.

Thank you for the reply. The errors in my first post are at the beginning of the console as soon as I load into JupyterLab. The errors that I posted latter occur when I try and run some code which includes output widgets from one of the broken extensions.

For instance, I get similar is not registered as a widget module when I try and run some code which uses ipyvolume;

What’s especially interesting here though is that jupyter labextension list as shown in an earlier post actually has ipyvolume v0.5.2 activated. I’ve noticed that ipyvolume was trying to install the out dated 0.6.0-alpha.5 extension by default, so I had added a jupyter labextension update --all to my configuration.

While this specific mismatch in version could be taken to the ipyvolume developers, it doesn’t explain why all the other extensions are failing too.

The first errors indicated that jupyter widgets was not installed correctly. That seems to not be the problem with these errors you’ve been showing - the errors now seem to be centered around a mismatch between the ipyvolume lab extension and the ipyvolume python package.

JupyterLab 3 makes it much easier to have these versions in sync, as you don’t have to do a separate lab extension install for many packages (the so-called “prebuilt extensions” in JLab 3). For example, I think you just install ipyvolume, and it will automatically install the right lab extension, no extra step needed.

Ipyvolume is being installed through conda and we don’t install the labextension seperately for any of these widgets. Version mismatch (by my understanding) cannot simply be the issue, because ipycytoscape says that 1.2.0 is not registered as a widget model in the 4th post of this thread but the second post shows that jupyter -cytoscape v1.2.0 is enabled and OK.

ipyvolume has a strange issue where it installs an older version of the extension thru conda (as I have seen with jupyter labextension list) but that’s probably just a bug that needs to be fixed by the widget’s maintainers.

For the rest of the widgets, the console output after running the code for that widget is just like the following;

Here I ran an ipyleaflet code cell, got an Error displaying widget: model not found as the output, and then you can see that the installed labextension for jupyter-ipyleaflet matches the version that the console says is not registered as a widget module.

If I were trying to trace down this problem, I’d probably trim down the installed packages to a working system, then introduce packages one by one to see which package was causing a problem (or perhaps a binary search on the packages). Once there was a specific package narrowed down, it’ll be much easier to look at it and see what the problem is, and much easier to get a simple reproducible test case for others to investigate. Of course, the errors point to specific packages to remove to see if you can get a working system. We’re only seeing part of the errors here, so it’s hard to help more. If you are comfortable with a browser debugger, you can also set a breakpoint on an error, and investigate what modules are registered (i.e., why it can’t find that specific version of ipyleaflet, for example).

I also think it would be helpful if ipywidgets printed out what is installed, not just that it can’t find something that is being requested. That would be a good issue for ipywidgets.

1 Like

Thanks for all the help. It looks like ipyvolume was just acting very strange and messing up all the rest of my installed extensions. When removing it, everything else functions properly now. Will just have to wait for those maintainers to update their widget for JupyterLab3.

And just following up, it looks like you’ve found the issue tracking this at Jupyterlab3 support · Issue #367 · maartenbreddels/ipyvolume · GitHub