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

Class OutputModel not found in module jupyter-js-widgets #1183

Closed
ischurov opened this Issue Mar 4, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@ischurov

ischurov commented Mar 4, 2017

I'm actually do not understand how brand new "rendering widgets in nbviewer" is expected to work, but I found, how it is not working.

I created a simple demo plotting a graph with matplotlib.pyplot and two sliders. It works in Jupyter but does not work in nbviewer.

The code is the following:

import ipywidgets as widgets
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np

@widgets.interact(a=widgets.FloatSlider(min=0, max=10, value=1, step=1e-3), 
          b=widgets.FloatSlider(min=0, max=10, value=1, step=1e-3))
def plot_sin(a, b):
    x = np.linspace(-4,4,300)
    plt.ylim(-2,2)
    plt.plot(np.sin(a*x)*b)
    plt.show()

Then I selected Widgets → Save Notebook with Widgets menu item, then uploaded ipynb-file to the server, then opened with nbviewer, see the link.

The actual sliders are rendered, but the output is not and I have the following error message instead of rendered content:

Could not create model:
Model name	OutputModel
Model module	jupyter-js-widgets
Model module version	~2.1.4
Class OutputModel not found in module jupyter-js-widgets

Actually, I didn't expect that my pictures will be shown correctly as they are dynamically created (depending on the positions of the sliders) on python side and nbviewer does not execute Python code. (The behaviour I theoretically might expect is that Jupyter tries to generate all possible combinations of pictures and instruct nbviewer to show the correct one depending on sliders, but it is obviously very time and space-consuming thing, especially if several widgets presented.) Anyway, currently the error message seem to be unclear for me. Is it a bug? A feature?

@janfreyberg

This comment has been minimized.

Show comment
Hide comment
@janfreyberg

janfreyberg Mar 5, 2017

+1, having the same issue with pyplot.imshow(). I get the exact same error message.

Mine is here:
http://nbviewer.jupyter.org/gist/janfreyberg/496e9d3f4a5ff2d41e7e0f3e60063ac4

janfreyberg commented Mar 5, 2017

+1, having the same issue with pyplot.imshow(). I get the exact same error message.

Mine is here:
http://nbviewer.jupyter.org/gist/janfreyberg/496e9d3f4a5ff2d41e7e0f3e60063ac4

@SylvainCorlay

This comment has been minimized.

Show comment
Hide comment
@SylvainCorlay

SylvainCorlay Mar 5, 2017

Member

That is right. The output widget used by interact is the only widget not supported in web contexts other than notebook and lab.

Since multiple people are affected by this, I make this a priority for 6.0.1.

Member

SylvainCorlay commented Mar 5, 2017

That is right. The output widget used by interact is the only widget not supported in web contexts other than notebook and lab.

Since multiple people are affected by this, I make this a priority for 6.0.1.

@janfreyberg

This comment has been minimized.

Show comment
Hide comment
@janfreyberg

janfreyberg Mar 5, 2017

Ah, that's great to know. Thanks!

janfreyberg commented Mar 5, 2017

Ah, that's great to know. Thanks!

@jasongrout jasongrout added this to the 6.1 milestone Mar 8, 2017

@maartenbreddels

This comment has been minimized.

Show comment
Hide comment
@maartenbreddels

maartenbreddels Apr 4, 2017

Member

Also hit by this here, good to see this is reported.

Member

maartenbreddels commented Apr 4, 2017

Also hit by this here, good to see this is reported.

@jasongrout

This comment has been minimized.

Show comment
Hide comment
@jasongrout

jasongrout Apr 4, 2017

Member

Closing as a duplicate of #986.

Member

jasongrout commented Apr 4, 2017

Closing as a duplicate of #986.

@jasongrout jasongrout closed this Apr 4, 2017

@jasongrout jasongrout modified the milestones: 6.1, 7.0 Apr 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment