1

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.

Brannon
  • 5,324
  • 4
  • 35
  • 83
  • is the notebook trusted? I had issues with running widgets on Google Colab where the notebook was not trusted, and all html elements, including widgets, would fail to load properly – Thomas E Nov 19 '20 at 15:26

1 Answers1

3

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.

blois
  • 1,506
  • 11
  • 6
  • Fixed in Pandarallel v1.5.7. Please not that the free version of Google Colab offers only one (hyperthreaded) core. Pandarallel won't speed your computation up using it. – Manu NALEPA Mar 03 '22 at 17:43