-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I'm trying to use tqdm along with multiprocessing.Pool in a notebook, and it doesn't quite seem to render correctly. The general problem appears to be well documented in Issue #407 and Issue #329, but neither of the fixes appear to have percolated to the notebook code. In particular, the "canonical example" in Issue #407 works for me on the command line, but when I move to a jupyter notebook and replace from tqdm import tqdm
with from tqdm import tqdm_notebook as tqdm
I get something like the following.
Changing the number of workers in the Pool yields different results, but the results are consistent (e.g. running with Pool(4) always shows progressers 1, 6, and 7).
During times when no progress bar is updating, I see the following error message repeatedly appearing on the terminal where the jupyter notebook is running.
[IPKernelApp] WARNING | WARNING: attempted to send message from fork
{'metadata': {}, 'msg_id': 'b58be6b1-80db-4a2d-9699-b3a4f3ddae8e', 'header': {'username': 'vramasub', 'version': '5.0', 'session': '667381c2-d872-4fc2-b2b5-06e33
957b17bb', 'msg_id': 'b58be6b1-80db-4a2d-9699-b3a4f3ddae8e', 'msg_type': 'comm_msg', 'date': datetime.datetime(2017, 12, 6, 15, 44, 13, 453842)}, 'content': {'dd
ata': {'state': {'value': '100% 5000/5000 [00:05<00:00, 877.55it/s]'}, 'buffers': [], 'method': 'update'}, 'comm_id': '486f6112cd1c496b95c4b25670f73786'}, 'mm
sg_type': 'comm_msg', 'parent_header': {'username': 'username', 'msg_id': 'FF1406FB5DC044BC98FFEDFF244B9E13', 'session': 'E79AAA8C69DA4475BAACFAD1D0EC9DAF', 'vee
rsion': '5.0', 'msg_type': 'execute_request', 'date': datetime.datetime(2017, 12, 6, 15, 43, 39, 135203)}}
For reference, this is the same issue noted here, a different project that is making use of tqdm internally. The terminal printing stops when progressbars are successfully printing in the notebook.
I have tested with both tqdm version 4.19.4 (the current version on pip) and the current master (installed using pip install -e git+https://github.com/tqdm/tqdm.git@master#egg=tqdm
). I have tested on both Linux (4.9.34-gentoo) and OS X (High Sierra 10.13.1). My jupyter version is 4.4.0 both on Linux and on OS X.