ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

Printed output not displayed when using joblib in jupyter notebook

Open zaccharieramzi opened this issue 5 years ago • 6 comments

So I am using joblib to parallelize some code and I noticed that I couldn't print things when using it inside a jupyter notebook.

I tried using doing the same example in ipython and it worked perfectly.

Here is a minimal (not) working example to write in a jupyter notebook cell

from joblib import Parallel, delayed
Parallel(n_jobs=8)(delayed(print)(i) for i in range(10))

So I am getting the output as [None, None, None, None, None, None, None, None, None, None] but nothing is printed.

Actually, checking the logs of the notebook process, I noticed that the prints happen there. I would like the prints to happen in the notebook, not the logs of the notebook process.

I have written an SO issue as well.

From what I understood discussing with @tomMoral, it may be related to the way the IO handler is passed to the child processes.

zaccharieramzi avatar May 07 '19 13:05 zaccharieramzi

+1

leliel12 avatar Oct 14 '19 20:10 leliel12

+1

ZGainsforth avatar Feb 04 '20 04:02 ZGainsforth

+1

spizwhiz avatar Jul 23 '20 18:07 spizwhiz

I am hitting this issue now. Any updates?

cossio avatar Jul 06 '21 15:07 cossio

2 years nobody care?

GF-Huang avatar Jul 10 '21 08:07 GF-Huang

This should have been fixed in ipykernel 6. Please try again.

ccordoba12 avatar Jul 10 '21 23:07 ccordoba12

+1

CamHolman avatar Sep 28 '22 20:09 CamHolman

@ccordoba12 it indeed works now with ipykernel==6.16.0. Closing this.

zaccharieramzi avatar Sep 29 '22 04:09 zaccharieramzi

ipykernel 6.18.0 and it doesn't work

gioxc88 avatar Dec 12 '22 13:12 gioxc88

ipykernel 6.20.1 still failing

jmigual avatar Jan 17 '23 13:01 jmigual

ipykernel 6.28.0 still failing

cfd0 avatar Mar 20 '24 21:03 cfd0

ipykernel v6.29.0 improved the situation for threads, but I think joblib uses processes? Maybe @krassowski has ideas, since he did all the work in #1186.

davidbrochart avatar Mar 20 '24 22:03 davidbrochart