`RuntimeError: Kernel didn't respond in 60 seconds`, when trying to run papermill with python multiprocessing
See original GitHub issueHello, I am trying to run multiple parameterized notebooks in parallel. Currently, I am using papermill inside Jupyter Notebook and if I try to use multiprocessing pool to map a list of parameters as pass them to pm.execute_notebook, I get RuntimeError: Kernel didn't respond in 60 seconds. I am running everything with Python 2.7.
This is the code I use:
import papermill as pm
import multiprocessing as mp
def run_nb(data):
d1, d2 = data
pm.execute_notebook(in_nb, out_nb, parameters = dict(d1=d1, d2=d2) )
pool = mp.Pool(4)
pool.map(run_nb, zip(data1, data2))
pool.close()
pool.join()
It works correctly using the standard python map.
Btw, is there a known way to produce multiple notebooks in parallel with papermill?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Jupyter notebook fails with "Kernel didn't respond"
I am running into a strange bug related to the sequential execution of Jupyter notebooks (Python 3 kernels). The main loop runs sequentially ......
Read more >client.py
Otherwise, IPython will create a history file for each kernel. When running kernels simultaneously (e.g. via multiprocessing) saving history a single SQLite ...
Read more >6.5.1 PDF - nbconvert Documentation
Executing notebooks using the Python API interface . ... When running kernels simultaneously (e.g. via multiprocessing) saving history a ...
Read more >[Example code]-Jupyter kernel dies on Ubuntu
On installation I open a Python 3 notebook initially it says "Kernel ... then in a couple of seconds it says that the...
Read more >How to Fix Kernel Error in Jupyter Notebook
A kernel error occurs basically when you try opening a python 3 file in the wrong directory. The truth is Jupyter and Python...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I might just be overlooking something, but I think I’m still experiencing this issue even after upgrading nbconvert. It seems to be an upstream issue with nbconvert, because I get the same issues when calling the execute API directly. Let me know if I should migrate this question to that repository.
To replicate:
test.ipynbhas a single cell that prints the word “testing”. The following works fine:But the following two code snippets each break
with error code
RuntimeError: Kernel didn't respond in 60 secondsin the first case andRuntimeError: Kernel didn't respond in 300 secondsin the second.I’m using Python 3.7. I’ve been able to replicate this with both nbconvert 5.6.0 and 5.6.1.
Thanks!
Wondering: what is the status for this issue? I can confirm that this problem is still present in Python3 when using Papermill. Will multiprocessing become doable with Papermill?