jupyter / jupyter/notebook

Notebook stuck in run mode

Open
#714 17 comments 2 reactions 1 assignee Claimed by @minrk View on GitHub
status:Needs Info tag:Windows
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

I have a weird issue which involves the notebook. The notebook gets stuck during the execution as some random position, the CPU becomes idle and the computation stops, while the notebooks shows the the `In[*]` prompt on the remaining cells. The system is windows x64, conda, python 3.4 with notebook 4.0.6 and nbconvert 4.1.

I have a set of notebooks used to analyze a dataset. These notebooks are run in sequence by a "master" notebook.

To run a notebook from the master notebook I use a function (`run_notebook()`) which does:

```python
nb = nbformat.read(nb_name_full, as_version=4)
ep = ExecutePreprocessor(timeout = 3600)
out = ep.preprocess(nb, {'metadata': {'path': './'}})
nbformat.write(nb, out_nb_name)
display(FileLink(out_nb_name))
```

Some notebooks take also input parameters which I add to the first cell before execution. In this case, I use a modified function (`run_notebook_template()`) which adds a cell with the parameters as follows:

```python
nb = nbformat.read(nb_name_full, as_version=4)
nb['cells'].insert(1, nbformat.v4.new_code_cell('data_id = "%s"' % data_id))
nb['cells'].insert(1, nbformat.v4.new_code_cell('ph_sel_name = "%s"' % ph_sel))
```

The complete functions are [here](https://gist.github.com/tritemio/816875a82e62758615b9).

Executing the master notebook with Run-All, or cell-by-cell, causes the execution to stop in some random cell calling `run_notebook_template()` (the parametric runner).

No messages are shown in the console (even in debug mode) except for autosaving messages. Only occasionally (i.e. after letting the notebook run overnight) I get this:

```
[IPKernelApp] WARNING | Timeout waiting for IOPub output
```

Let me know if you need more info.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.