ipykernel
ipykernel copied to clipboard
Printed output not displayed when using joblib in jupyter notebook
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.
+1
+1
+1
I am hitting this issue now. Any updates?
2 years nobody care?
This should have been fixed in ipykernel 6. Please try again.
+1
@ccordoba12 it indeed works now with ipykernel==6.16.0
.
Closing this.
ipykernel 6.18.0 and it doesn't work
ipykernel 6.20.1 still failing
ipykernel 6.28.0 still failing
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.