Error displaying widget: model not found -- how to fix this?

So as to use Stacked, I installed version 8:

> pip uninstall ipywidgets
> pip install ipywidgets==8.0.0b

But upon displaying a Stacked widget, this error was issued:

Error displaying Widget

Thus I then went back to version 7:

> pip uninstall ipywidgets
> pip install ipywidgets

Alas, now version 7 does not work either.

I made sure all the related processes were killed. I closed all notebooks. Then:

 > pip uninstall matplotlib
 > pip uninstall pandas
 > pip uninstall ipywidgets
 > pip uninstall jupyterlab

followed by:

pip install matplotlib
pip install pandas
pip install jupyterlab
pip install ipywidgets

And then … the exact same problem model not found

Alas, what is the magic incantation to fix the setup?

It’s a bit hard to tell, but there may be more information in the browser console (usually shown by pressing F12).

My hunch is you’ve gotten the state of your frontend versions confused, which can be listed out via jupyter labextension list. The jupyterlab assets are distributed in jupyterlab-widgets:

Sometimes in-the-wild packages don’t have enough knowledge of the future to know they need to be up or downgraded when pre-release packages are in the mix.

what is the magic incantation to fix the setup?

Similarly, without the output of pip freeze, it’s hard to know exactly what the setup is.

I have found pip, in particular, to be kind of unpredictable when used interactively over a long period of time… I can’t recommend enough adopting something that gives you disposable, reproducible environments, e.g. tox, virtualenv, conda. This will allow you to more easily switch between multiple versions of upstreams, especially when using pre-release software… but really, whenever. Having one or more requirements.txt or environment.yml understood by multiple tools can also make this useful in e.g. CI… i’ve found some tools, such as poetry, to actively make this harder as it strives very hard for some kind of “right” answer, which is often not as useful as “likely to be found by a user.”

1 Like

This turned out to be the key:

jupyter labextension list

Note:

> jupyter labextension list
JupyterLab v3.2.4
.local/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v4.0.0-beta.0 enabled OK (python, jupyterlab_widgets)

> pip uninstall jupyterlab_widgets
Found existing installation: jupyterlab-widgets 2.0.0b0
Uninstalling jupyterlab-widgets-2.0.0b0:

> pip install jupyterlab_widgets
Defaulting to user installation because normal site-packages is not writeable
Collecting jupyterlab_widgets
  Using cached jupyterlab_widgets-1.0.2-py3-none-any.whl (243 kB)
Installing collected packages: jupyterlab-widgets
Successfully installed jupyterlab-widgets-1.0.2

> jupyter labextension list
JupyterLab v3.2.4
.local/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

Now it works again.

Thanks again.

I am trying to use ipyaggrid at jupyterlab3.x recently. I have the same problem.‘Error displaying widget: model not found’. I tryed in jupyterlab2.x. It works.
Does anyone knows how to fixed this problem.It will be very thanks.
In addition,I tryed use ipyaggrid in jupyter notebook. It also useable.
Oh my God,I’m going nuts
help me please