Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not use tqdm_notebook in notebook

When I use the tqdm_notebook in iteration:

from tqdm import tqdm_notebook as tqdm

It only shows:

HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))

How can I do?

like image 623
Kay Zhou Avatar asked Jan 29 '19 21:01

Kay Zhou


People also ask

How do I enable Ipywidgets in Jupyter notebook?

Simply install the python ipywidgets package with pip (pip install ipywidgets==7.6. 0) or conda/mamba (conda install -c conda-forge ipywidgets=7.6. 0) and ipywidgets will automatically work in classic Jupyter Notebook and in JupyterLab 3.0.

What is TQDM () in Python?

tqdm derives from the Arabic word taqaddum (تقدّم) which can mean “progress,” and is an abbreviation for “I love you so much” in Spanish (te quiero demasiado). Instantly make your loops show a smart progress meter - just wrap any iterable with tqdm(iterable), and you're done!


1 Answers

For use in JupyterLab:

  1. install ipywidgets package:

    With pip

    pip install ipywidgets

    jupyter nbextension enable --py widgetsnbextension

    With conda

    conda install -c conda-forge ipywidgets

    (Installing ipywidgets with conda will also enable the extension for you.)

  2. Then run the following command to install the Jupyter widgets extension for FigureWidget support (note that this will require nodeJs to be installed in your system):

jupyter labextension install @jupyter-widgets/jupyterlab-manager

like image 117
laifi Avatar answered Oct 01 '22 00:10

laifi