Skip to content

The canonical multiprocessing example displays only a single bar #407

@mojones

Description

@mojones

I'm trying to use tqdm to monitor multiple FTP downloads using ftplib. Browsing around the documentation led me to this "canonical" example:

from time import sleep
from tqdm import tqdm
from multiprocessing import Pool, freeze_support

def progresser(n):
    text = "progresser #{}".format(n)
    for i in tqdm(range(5000), desc=text, position=n):
        sleep(0.001)

if __name__ == '__main__':
    freeze_support()  # for Windows support
    L = list(range(10))
    Pool(len(L)).map(progresser, L)

but on my system (Ubuntu 14.04, Python 3.4.3, tqdm 4.14.0) I get a mixture of empty lines, non-updating progress bars, and a single updating progress bar at the bottom:

selection_035

If I watch the bottom progress bar carefully I can see that the name occasionally changes, so I think that the progress bars are being drawn on top of one another. I've searched the issues and the closest thing I can find is this:

#285

but I don't think it's the same problem, as that issue reported multiple updating progress bars visible and I am only seeing one (the screenshots are very different). Let me know if I can provide any other info - I really want to use tqdm for this project but am out of depth when it comes to trying to figure out what's wrong.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions