pandarallel widgets don't work on Google Colab

1.7k Views Asked by At

Pandarallel supports nice progress widgets. However, I can't get them to appear when using Google Colab. I get output like this instead:

enter image description here

This chunk of code, which is supposed to enable the widgets, runs successfully in my notebook (before I use any parallel calls):

%pip install pandas librosa pandarallel jupyterlab jupyter_contrib_nbextensions jupyter-client -U
!jupyter nbextension enable --py widgetsnbextension
!jupyter labextension install @jupyter-widgets/jupyterlab-manager  --no-build

What am I missing?

Update: when I connect Google Colab to a local Jupyter instance, I see the proper widgets. It's only a problem when trying to run on the Google Jupyter instance.

1

There are 1 best solutions below

1
blois On BEST ANSWER

The is_notebook_lab check is too narrow, you can overwrite it and force to be true:

from pandarallel.utils import progress_bars

progress_bars.is_notebook_lab = lambda : True

FWIW for the installation you should only have to do %pip install pandarallel- the extension installation steps above should not be needed.