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

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

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

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

ischurov opened this issue Mar 4, 2017 · 5 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@ischurov
Copy link

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
Copy link

+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
Copy link
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.

@janfreyberg
Copy link

Ah, that's great to know. Thanks!

@jasongrout jasongrout added this to the 6.1 milestone Mar 8, 2017
@maartenbreddels
Copy link
Member

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

@jasongrout
Copy link
Member

Closing as a duplicate of #986.

@jasongrout jasongrout modified the milestones: 6.1, 7.0 Apr 4, 2017
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

5 participants