tqdm notebook bar outputs text in Jupyter lab

Question:

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).

Asked By: gorka.munoz

||

Answers:

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
Answered By: aaronrmm
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.