Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interactive Jupyter Widgets not working in Jupyter Lab

I noticed that interactive widgets are not working in my Jupyter Lab notebooks.

The following code should produce an interactive slider but doesn't:

from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets

def f(x):
    return x

interact(f, x=10);

enter image description here

What is the problem here, and how can I get widgets to work?

like image 643
clstaudt Avatar asked Oct 01 '18 11:10

clstaudt


People also ask

Can jupyter notebooks be interactive?

Jupyter Notebook has support for many kinds of interactive outputs, including the ipywidgets ecosystem as well as many interactive visualization libraries.

How do I install JupyterLab widgets?

Simply install the python ipywidgets package with pip (pip install ipywidgets==7.6. 0) or conda/mamba (conda install -c conda-forge ipywidgets=7.6. 0) and ipywidgets will automatically work in classic Jupyter Notebook and in JupyterLab 3.0.

Why is JupyterLab not working?

Jupyter doesn't load or doesn't work in the browserTry disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.


1 Answers

You need to install widget extension

pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension --sys-prefix
like image 111
varun vasudevan Avatar answered Oct 17 '22 03:10

varun vasudevan