Brannon
Brannon

Reputation: 5414

pandarallel widgets don't work on Google Colab

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.

Upvotes: 1

Views: 1880

Answers (2)

chikich
chikich

Reputation: 50

New pandarallel version has different path for is_notebook_lab method:

import pandarallel.progress_bars 
pandarallel.progress_bars.is_notebook_lab = lambda: True

Also works for databricks

Upvotes: 0

blois
blois

Reputation: 1526

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.

Upvotes: 3

Related Questions