cph_sto
cph_sto

Reputation: 7607

Failed to display Jupyter Widgets

I have installed Anaconda on my new laptop and I can't use the library ipywidgets any more. Just an example snippet of the code which I ran for test purposes -

import ipywidgets as widgets
from IPython.display import display
w = widgets.IntSlider()
display(w)

I got the following Javascript error :

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'IntSliderModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however,         2.0.0 is
    at f.loadClass (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:75041)
    at f.loadModelClass (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:10729)
    at f._make_model (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:7517)
    at f.new_model (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:5137)
    at f.handle_comm_open (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:3894)
    at _handleCommOpen (http://localhost:8889/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:73457)
    at v._handleCommOpen (http://localhost:8889/static/notebook/3676.bundle.js:1:30808)
    at async v._handleMessage (http://localhost:8889/static/notebook/3676.bundle.js:1:32702)

The solution suggested at various places has been to change the version of ipywidgets, as there are some compatibility issues. My ipywidgets is 7.6.5 and I tried changing it to 7.7.5, 7.7.2 and a couple of more, but I keep getting the Javascript error.

The following are my Jupyter core packages' versions:

IPython          : 8.20.0
ipykernel        : 6.28.0
ipywidgets       : 7.6.5
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.10.0
jupyterlab       : 4.0.11
nbclient         : 0.8.0
nbconvert        : 7.10.0
nbformat         : 5.9.2
notebook         : 7.0.8
qtconsole        : 5.4.2
traitlets        : 5.7.1

Where am I making a mistake? Thanks.

Upvotes: 0

Views: 1894

Answers (0)

Related Questions