I am using tqdm to print progress in a script I\'m running in a Jupyter notebook. I am printing all messages to the console via tqdm.write(). Howev
For everyone who is on windows and couldn't solve the duplicating bars issue with any of the solutions mentioned here. I had to install the colorama package as stated in tqdm's known issues which fixed it.
pip install colorama
Try it with this example:
from tqdm import tqdm
from time import sleep
for _ in tqdm(range(5), "All", ncols = 80, position = 0):
for _ in tqdm(range(100), "Sub", ncols = 80, position = 1, leave = False):
sleep(0.01)
Which will produce something like:
All: 60%|████████████████████████ | 3/5 [00:03<00:02, 1.02s/it]
Sub: 50%|██████████████████▌ | 50/100 [00:00<00:00, 97.88it/s]