question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPyWidgets + JupyterLab 0.25.2

See original GitHub issue

Installation

Installing with a blank conda env as follows:

conda create --name jlab-widgets python
source activate jlab-widgets
pip install jupyterlab
pip install --pre ipwidgets
jupyter labextension install @jupyter-widgets/jupyterlab-manager

This shows the following versions:

(jlab-widgets) oliver@oliver-arch:~ % pip show jupyterlab
Name: jupyterlab
Version: 0.25.2
Summary: An alpha preview of the JupyterLab notebook server extension.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /home/oliver/local/miniconda3/envs/jlab-widgets/lib/python3.6/site-packages
Requires: notebook, jupyterlab-launcher
(jlab-widgets) oliver@oliver-arch:~ % 
(jlab-widgets) oliver@oliver-arch:~ % jupyter labextension install @jupyter-widgets/jupyterlab-manager
(jlab-widgets) oliver@oliver-arch:~ % pip show jupyterlab ipywidgets
Name: jupyterlab
Version: 0.25.2
Summary: An alpha preview of the JupyterLab notebook server extension.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /home/oliver/local/miniconda3/envs/jlab-widgets/lib/python3.6/site-packages
Requires: notebook, jupyterlab-launcher
---
Name: ipywidgets
Version: 7.0.0a11
Summary: IPython HTML widgets for Jupyter
Home-page: http://ipython.org
Author: IPython Development Team
Author-email: ipython-dev@scipy.org
License: BSD
Location: /home/oliver/local/miniconda3/envs/jlab-widgets/lib/python3.6/site-packages
Requires: nbformat, ipykernel, widgetsnbextension, traitlets, ipython

and

(jlab-widgets) oliver@oliver-arch:~ % jupyter labextension list
JupyterLab v0.25.2
Known labextensions:
   app dir: /home/oliver/local/miniconda3/envs/jlab-widgets/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager  enabled  OK

Not working

Trying the following in Jupyter Lab (after from ipywidgets import *):

In [1]:
interact(lambda x: x, x=True)

True
Out[1]:
<function __main__.<lambda>>

produces no widget, and the following js console errors:

manager-base.js:258 Could not instantiate widget
(anonymous) @ manager-base.js:258
step @ manager-base.js:34
(anonymous) @ manager-base.js:15
rejected @ manager-base.js:7
utils.js:84 Error: Could not create a model.
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
utils.js:84 Error: Could not process update msg for model id: ab5ef35ea7ff4671b23058eba12f4898
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
utils.js:84 Error: Could not create view
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
lab:1 Uncaught (in promise) Module @jupyter-widgets/output, semver range 3.0.0 is not registered as a widget module
lab:1 Uncaught (in promise) Module @jupyter-widgets/output, semver range 3.0.0 is not registered as a widget module

Also,

In [6]:
o = Output()
o

Error displaying widget

produces no further output and the following js console errors (similar to before):

manager-base.js:258 Could not instantiate widget
(anonymous) @ manager-base.js:258
step @ manager-base.js:34
(anonymous) @ manager-base.js:15
rejected @ manager-base.js:7
utils.js:84 Error: Could not create a model.
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
lab:1 Uncaught (in promise) Module @jupyter-widgets/output, semver range 3.0.0 is not registered as a widget module

Mostly working

Some things are working fine. For example,

 [7]:
s = IntSlider()
l = []
def f(change):
    l.append(change['new'])
s.observe(f, names='value')
s

--o-------- 44 (IntSlider widget)

In [10]:
l
Out[10]:
[3, 9, 37, 57, 56, 31, 12, 11, 23, 42, 52, 51, 37, 34, 38, 44]

appends to the list upon sliding as expected, however it still produces similar errors:


utils.js:84 Error: Could not create child view
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
utils.js:84 Error: Could not add styleView to DOMWidgetView
    at promiseRejection (utils.js:84)
    at <anonymous>
promiseRejection @ utils.js:84
lab:1 Uncaught (in promise) Class StyleView not found in module @jupyter-widgets/base
lab:1 Uncaught (in promise) Class StyleView not found in module @jupyter-widgets/base

Thanks! Oliver

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jasongroutcommented, Jul 17, 2017

#1506 fixes the style issue. Thanks again for pointing these out!

I just released these fixes. You should be able to install the new version with jupyter labextension install @jupyter-widgets/jupyterlab-manager

Edit: fixed typo

0reactions
hainmcommented, Jul 20, 2017

wow, it’s working. Thanks so much @jasongrout. I am gonna cry.

screen shot 2017-07-20 at 1 16 57 am
Read more comments on GitHub >

github_iconTop Results From Across the Web

ipywidgets JupyterLab extension - Read the Docs
No information is available for this page.
Read more >
itkwidgets - PyPI
Interactive Jupyter widgets to visualize images, point sets, and meshes in 2D and 3D.
Read more >
@jupyter-widgets/jupyterlab-manager NPM | npm.io
A JupyterLab 3.0 extension for Jupyter/IPython widgets. Installation. To enable ipywidgets support in JupyterLab 3.x: pip install jupyterlab_widgets. Version ...
Read more >
Using itkwidgets with PyVista
PyVista has an interface for visualizing plots in Jupyter. The pyvista.PlotterITK class allows you interactively visualize a mesh within a jupyter notebook.
Read more >
Interactive data analysis with figurewidget ipywidgets in Python
Let's assign the widgets that we're going to be using in our app. In general all these widgets will be used to filter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found