Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets are not displayed after update to 4.2.0 #1386

Closed
wikiped opened this issue Apr 22, 2016 · 9 comments · Fixed by #1389
Closed

Widgets are not displayed after update to 4.2.0 #1386

wikiped opened this issue Apr 22, 2016 · 9 comments · Fixed by #1389

Comments

@wikiped
Copy link

wikiped commented Apr 22, 2016

Trying to run this code in a notebook:

from ipywidgets import widgets
from IPython.display import display
s = widgets.IntSlider()
display(s)

results in nothing.

After downgrading to notebook 4.1.0 the same code works as expected - widget is shown.

Installed packages:

ipython = 4.2.0
ipywidgets = 4.1.1

Browser: Firefox 46.0

Errors in browser console:

Could not open comm  --  Error: Class ipython.widget not found in registry 
Stack trace:
load_class/<@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:12844:28
load_class@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:12829:16
CommManager.prototype.comm_open@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:21996:31
.proxy/i@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:87:5486
Kernel.prototype._handle_iopub_message@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:23338:20
Kernel.prototype._finish_ws_message@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:23175:24
Kernel.prototype._handle_ws_message/this._msg_queue<@http://localhost:8888/static/notebook/js/main.min.js?v=1c2abb797e9945d6ce7d58ae051fe985:23166:39
 main.min.js:12880:17

Couldn't process kernel message Object { fileName: "http://localhost:8888/static/notebo…", lineNumber: 12799, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:23167:34

Couldn't process kernel message Object { fileName: "http://localhost:8888/static/notebo…", lineNumber: 12799, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:23167:34

Posting it here since the package "responsible" for the change in behavior seems to be notebook

@minrk
Copy link
Member

minrk commented Apr 22, 2016

cc @jdfreder, @SylvainCorlay. Previous widget should work with notebook-4.2, right? What did we change here?

@minrk minrk added this to the 4.2.1 milestone Apr 22, 2016
@willingc
Copy link
Member

For reference, here is the documentation for ipywidgets 5.1

I wonder if this needs to run now to enable 4.1.1 widgets for notebook 4.2:
jupyter nbextension enable --py widgetsnbextension

@wikiped
Copy link
Author

wikiped commented Apr 22, 2016

I did try this:

 jupyter nbextension enable --py widgetsnbextension

Had no effect.

I use conda and it might be worth noting that getting this command to run is taking an effort.
widgetsnbextension is not available on conda. It doesn't appear in search results if you do pip search widgetsnbextension, but strangely enough this: pip install widgetsnbextension works.

@SylvainCorlay
Copy link
Member

@minrk I am debugging this at the moment, it seems that the code checking for presence of widgets 4.x works but loading the widgets themselves fails.

[Error: Load timeout for modules: bootstrap,jquery-ui]

Is this a problem with the webpacking of the notebook?

@SylvainCorlay
Copy link
Member

@wikiped we are certainly going to fix this issue with 4.x, but in any case updating to widgets 5.0 should fix your issue.

pip install ipywidgets==5.0.0
jupyter nbextension enable --py widgetsnbextension

FYI, widgets 5.0 change the way you author custom javascript widgets.

@wikiped
Copy link
Author

wikiped commented Apr 22, 2016

@SylvainCorlay Thank you. Installed 5.0.0 - problem is solved.
Shall I close this issue?

@SylvainCorlay
Copy link
Member

No, notebook 4.2 should work with the version of widgets you had earlier. I am trying to fix this right now!

@willingc
Copy link
Member

@wikiped I'm glad that you were able to get it working with ipywidgets 5.0.0.

@lovebug356
Copy link

I had the same issue after a clean jupyter install in a virtualenv. I upgraded to ipywidets=5.0.0 and I have my widgets again. However, there is still a (misleading) comment in the logs:

$ jupyter notebook
/home/tvermeir/.pyenv/versions/3.5.1/envs/cce/lib/python3.5/site-packages/widgetsnbextension/__init__.py:30: UserWarning: To use the jupyter-js-widgets nbextension, you'll need to update
    the Jupyter notebook to version 4.2 or later.
  the Jupyter notebook to version 4.2 or later.""")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants