Jupyter Notebooks not displaying progress bars

Read all of it before executing a command:

I followed all the instructions here, multiple times, nothing worked.

In my last try, I did:

Create new environment and install jupyterlab

From https://github.com/nodesource/distributions/blob/master/README.md#debinstall:

# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_15.x | bash -
apt-get install -y nodejs

then:

conda install -c conda-forge nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
conda install -c conda-forge ipywidgets

Still it didnt work. Then as advised here, I did:

jupyter labextension install js

Restarted jupyter lab, tried the code:

import ipywidgets as widgets
widgets.IntSlider()

And it finally worked. So I guess what was missing was to install js through jupyter labextension.


An important consideration here is to have node version >=10.0.0 for this to work. To check your node version use:

node -v

Also, you may have a version of node >=10 installed, but not selected. To check the list of installed node versions, you can use the node version manager nvm using:

nvm ls

In the example below, the selected version is 9.11.2:

->      v9.11.2
        v10.4.0
        v12.5.0

In order to fix this, I will have to run:

nvm use 12.5.0

Now, I can run the two commands mentioned by @Mihai:

jupyter nbextension enable --py widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager

It should work now after refreshing the Jupyter browser tab.


The answer is in this GitHub issue.

The key is to ensure that you have the ipywidgets notebook extension enabled using the following command:

jupyter nbextension enable --py widgetsnbextension

For the old JupyterLab 2.0 you'll also need to install the JupyterLab extension:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

For the old JupyterLab 2.0 installing the JupyterLab extension with the command above requires that you have Node.js installed. The installer from the Node.js website includes npm, which is also required for the command to run properly.

When using JupyterLab 3.0, the extension will be auto-installed together with ipywidgets when you install it with pip or conda. Node.js is no longer required for JupyterLab 3.0.