17

I am having a problem when using tqdm.notebook progress bar in Jupyter (version 3.4.4). When I launch a for loop, instead of the progress bar, I get the following text as output:

Input:

from tqdm.notebook import tqdm

for i in tqdm(range(100)):
    a = 1

Output:

root:
    n: 0
    total: 100
    elapsed: 0.01399087905883789
    ncols: null
    nrows: 29
    prefix: ""
    ascii: false
    unit: "it"
    unit_scale: false
    rate: null
    bar_format: null
    postfix: null
    unit_divisor: 1000
    initial: 0
    colour: null

This started happening after I updated Jupyter to its latest version. The usual solutions regarding Node.js and ipywidgets (see this one) didn't do the job.

tqdm is also in its last version (4.63.0).

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
gorka.munoz
  • 181
  • 1
  • 4
  • 1
    I have the same issue and this bug report cover the same issue https://github.com/tqdm/tqdm/issues/1359 but not solution yet (I cannot downgrade my versions otherwise I am getting other issues. – Dr. Fabien Tarrade Aug 26 '22 at 13:28

1 Answers1

14

I ran across this in a dockerized jupyterlab service. This fixed it for me:

(Done in the Dockerfile):

  1. pip install -U jupyterlab-widgets==1.1.1
  2. pip install -U ipywidgets==7.7.2
Isopycnal Oscillation
  • 3,234
  • 6
  • 21
  • 37
aaronrmm
  • 441
  • 4
  • 7
  • Thanks! This solved it. However, I find it strange that I have to downgrade the versions of both packages for it to work... Is it a tqdm dependency problem? – gorka.munoz Aug 26 '22 at 08:04
  • 1
    Yes, currently downgrading ipywidgets should work as a temporary solution, until the relevant bug is fixed. It also worked for me with: `ipywidgets==7.7.2` – T.V. Aug 27 '22 at 11:46
  • I had to run this too: `jupyter labextension install @jupyter-widgets/jupyterlab-manager`. Then, reload. – Noel Victorino Sep 01 '22 at 14:55