I'm trying to display multiple progress bars for parallel processes inside a jupyter notebook. The following works in a normal python console and correctly displays two parallel error bars:
funcs.py
def product_(a, b):
for _ in tqdm(range(10)):
sleep(0.1)
return a * b
main.py
from time import sleep
from funcs import product_
import multiprocessing
with multiprocessing.Pool(processes=2) as pool:
results = pool.starmap(product_, iter([(1, 2), (3, 4)]))
But the equivalent in a jupyter notebook (replacing import tqdm
by import tqdm.notebook
) doesn't show anything.
Note that I don't want a progress bar over processes, but over a loop inside each of the processes.