Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Plotly jupyter widget error

Hi there, I downloaded the example plotly + jupyter-widgets notebook but am having trouble displaying a GraphWidget.

My first imports work fine:

import plotly.plotly as py
from plotly.graph_objs import *

The next one gives a red warning:

from plotly.widgets import GraphWidget

Warning text (screenshot):

/Users/ryan/.local/lib/python3.4/site-packages/IPython/ ShimWarning:

The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.

/Users/ryan/.local/lib/python3.4/site-packages/IPython/utils/ UserWarning:

IPython.utils.traitlets has moved to a top-level traitlets package.

Instantiating a GraphWidget succeeds:

g = GraphWidget('')

but attempting to display it fails:


Several JS errors are logged:

The error message that jumps out at me from them is:

Class GraphView not found in registry at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js:31987:25 at Object.loadClass (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js:31948:13) at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js:32171:23

This issue (; I can’t put more than two links in a post apparently) implies that version mismatches between jupyter/widget components can cause errors like this, but it seems like all my versions are consistent:

$ pip list | grep widgets
ipywidgets (5.1.5)
widgetsnbextension (1.2.3)
$ conda list | grep widgets
ipywidgets                5.1.5                    py34_0
widgetsnbextension        1.2.3                    py34_1
$ pip list | grep jupyter
jupyter (1.0.0)
jupyter-client (4.2.2)
jupyter-console (4.1.1)
jupyter-core (4.1.0)
$ conda list | grep jupyter
jupyter                   1.0.0                     <pip>
jupyter-client            4.2.2                     <pip>
jupyter-console           4.1.1                     <pip>
jupyter-core              4.1.0                     <pip>
jupyter_client            4.2.2                    py34_0
jupyter_core              4.1.0                    py34_0
$ conda list | grep plotly
plotly                    1.11.0                    <pip>
$ pip list | grep plotly
plotly (1.11.0)
$ python --version
Python 3.4.4 :: Anaconda 2.2.0 (x86_64)
$ jupyter --version

This is a Python 3 kernel and my Jupyter server and all paths should be pointing to Python3 libraries.

I’m out of leads but would really like to be able to use plotly jupyter widgets; any help would be appreciated, thanks!