Forums

ipython widget not showing

There's an Ipython notebook sampling.ipynb from the repository https://github.com/AllenDowney/CompStats.

This notebook generally works just fine at PythonAnywhere, but with one exception: The ipython slider widget does not display at all.

The code, spread over several cells, is in part:

from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
slider = widgets.IntSlider(min=10, max=1000, value=100)
interact(plot_sample_stats, n=slider, xlim=fixed([55, 95]))

What we see is the plot, but with no visible widget. A check of Developer tools in Chrome showed some error involving widgets.

Some research suggests that maybe there is an ipywidgets version issue (reference: https://github.com/jupyter/notebook/issues/1386#issuecomment-213565839)

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

I didn't want to try these for fear of messing up something.

What should I do to get the widget to work?

At the moment javascript widgets don't work in notebooks on PythonAnywhere. We're working on a fix.

Hello,

I am having similar difficulties with installing jupyter-declarativewidgets. It installs fine but fails to be enabled.

jupyter nbextension enable declarativewidgets --py 
    Traceback (most recent call last):
  File "/usr/local/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
...
    ImportError: No module named declarativewidgets

I was wondering if the issues have been resolved. Thanks.

No. We're still working on that.

Has this been resolved? I am looking into a class that requires this.

Unfortunately not.

Any resolution yet?

No, still none :-(

HI - I assume the same fix would be required for pdvega to work?

jupyter nbextension install --sys-prefix --py vega3

Hmm, it depends on whether it's using widgets -- it might be worth a try, but our best guess is that it probably won't work.

Hi , same issue for me - Jupiter interactivity is increasingly important any update on resolution ?

No updates on this, but it's an issue that we're tracking -- I've added an upvote on your behalf.

This is important for me too :)

I'm getting the following result when I try to run the widget:

Widget Javascript not detected.  It may not be installed properly. Did you enable the widgetsnbextension? If not, then run "jupyter nbextension enable --py --sys-prefix widgetsnbextension"

but

import ipywidgets as widgets

works

Thanks for letting us know -- I've added another upvote.

Please add an upvote for me too!

No problem.

need this bad. please add an upvote for me too.

upvoted!

upvoted!!

Thanks :-) It's quite high on our priority list, though we don't have a formal timeline yet.

So... is there any idea on when we can expect this to work? ...it's been three years since the first mention of this issue.

Is there anything we can do to help?

We just have a long list of features to address, so it's hard to tell.

That makes perfect sense. Is there another way to get form functionality in yupiter notebooks perhaps?

Not that I know of.

hello Any news about this issue?

not yet

I'll throw in my upvote here. It would be nice to have.

sure, upvoted

UPDATE: We released our new system image, "haggis", with updated jupyter which provides support for widgets. See this blog post for more information.