Mehran
Mehran

Reputation: 16931

How to fix ipywidgets when they are not rendered in a jupyter-lab notbook?

I have jupyter-lab version 3.6.3 installed and it fails to render ipywidgets. I followed the instructions mentioned in their documentation and it still does not render.

These are the steps I've taken:

conda install -n base -c conda-forge widgetsnbextension
conda install -n test_env -c conda-forge ipywidgets

I run the jupyter-lab in the base env from the terminal and then select the test_env as for my kernel when the notebook loads. Then I run the following cell:

from IPython.display import display
import ipywidgets as widgets

w = widgets.IntSlider()
display(w)

And it outputs:

IntSlider(value=0)

I have restarted the jupyter-lab process multiple times to make sure the changes are in effect. And still, no luck.

Any suggestions?

Upvotes: 1

Views: 1943

Answers (1)

Mehran
Mehran

Reputation: 16931

If anyone else faced the same problem, these additional steps fixed the problem for me:

sudo jupyter nbextension enable --py widgetsnbextension --sys-prefix

And

sudo jupyter labextension install @jupyter-widgets/jupyterlab-manager

Upvotes: 1

Related Questions