I am trying to display two TQDM progress bar in Jupyter Notebook. I'm using VSC with Jupyter Notebook and Python 3.9.
I have the following code:
from pathlib import Path
from tqdm.autonotebook import tqdm
outerdir = Path('some/path')
dirs = list(outerdir.iterdir())
for dir in tqdm(dirs, desc='outer'):
files = dir.iterdir()
for file in tqdm(files, desc='inner'):
**do something**
However, my output is as follows:
outer: 0%| | 0/217 [00:00<?, ?it/s]
Meaning, it only shows the outer progress bar, not the inner. In addition, it does not show the ETA and the speed.
Does anyone know why that is?
NB: It was working when I still used os
instead of pathlib
to manage paths and folder iteration.
[Edit]: The code inside the inner loop is taking at least 1 min per run. There are approximately 50 runs of the inner loop for each iteration of the outer loop, so the outer loop is taking at least 50 min per run. This means that the duration of the loop should not be the problem.