2

I'm attempting to run a very simple tqdm script:

from tqdm.notebook import tqdm
for i in tqdm(range(10)):
    time.sleep(1)

but am met with:

IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html

My ipywidgets is v8.0.4 and jupyter v1.0.0... does tqdm not work anymore with VS Code Jupyter Notebook?

liamhp
  • 111
  • 1
  • 7

2 Answers2

2

This little syntax solved my problem

conda install -c conda-forge ipywidgets

Remember to restart your kernel after installation. It didn't work until I restarted my VS Code. Hope it helps

yts61
  • 1,142
  • 2
  • 20
  • 33
0

I had the same problem. Using this post I resolved it by running:

%pip install --upgrade jupyter ipywidgets
%jupyter nbextension enable --py widgetsnbextension # removed !pip on the recommendation of a comment.

import time
from tqdm.notebook import tqdm
for i in tqdm(range(10)):
    time.sleep(0.1)
Kai Lukowiak
  • 63
  • 1
  • 6
  • 2
    Minor thing: When using `pip install` from inside a notebook, you'll have a better experience if you don't use the exclamation point with it, and use the modern magic command added to insure the installation occurs in the environment being used by the kernel underlying the active notebook, see [here](https://discourse.jupyter.org/t/why-users-can-install-modules-from-pip-but-not-from-conda/10722/4?u=fomightez) for more about the modern magic commands added to overcome exclamation point shortcomings. You should be suggesting others use that in current Jupyter as well. ... – Wayne Apr 16 '23 at 02:58
  • 1
    See [the second paragraph here](https://discourse.jupyter.org/t/location-of-libraries-or-extensions-installed-in-jupyterlab/16303/2?u=fomightez) for a good summary of why the exclamation point use with install commands can lead to issues. – Wayne Apr 16 '23 at 02:58
  • 1
    Thanks @Wayne, I've updated it. I noticed my linter recommending it but I had no idea why. – Kai Lukowiak Apr 17 '23 at 13:35
  • 1
    I'm not sure the `jupyter nbextension enable` line should be without the exclamation point though? Did you verify that? – Wayne Apr 17 '23 at 15:50
  • 1
    It does somewhat enterprisingly. I checked after I posted to be sure. – Kai Lukowiak Apr 18 '23 at 16:32