Does anyone nows how can we have python tqdm progress bar working on a Sagemaker Jupyterlab Noteook ? The tqdm progress bar is never displayed, components are displayed as their code.
Example :
HBox(children=(FloatProgress(value=0.0, max=5234.0), HTML(value='')))
I'm aware of the usual fix describe here, but It does not work since trying to executing jupyter lab build
will results in the issue describe here
Many thanks.
tqdm works on any platform (Linux, Windows, Mac, FreeBSD, NetBSD, Solaris/SunOS), in any console or in a GUI, and is also friendly with IPython/Jupyter notebooks.
Thanks for using Sagemaker Notebooks!
I got this working by following the instructions in your links.
Note: I had to use the Jupyter terminal instead of using a magic !
from the notebook. There was a lot of output during the installation which slowed Jupyter down too much.
So in the terminal:
jupyter labextension install @jupyter-widgets/jupyterlab-manager > /dev/null
then:
jupyter nbextension enable --py widgetsnbextension
At this point you need to reload Jupyterlab in your browser. This is because the labextension build generates a new javascript bundle that you must reload to get.
Finally in the notebook:
!pip install tqdm
and then the example worked:
import time
from tqdm import tqdm_notebook
example_iter = [1,2,3,4,5]
for rec in tqdm_notebook(example_iter):
time.sleep(.1)
Hope this helps!
You should also try in a new notebook instance to ensure you are on the latest version of Jupyterlab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With