ipython / ipython/ipykernel

Cannot restart and run all cells in notebooks with %gui qt magic

Open
#559 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
734
Forks
412
Avg merge
1d 5h
Merged PRs (30d)
8

Description

# Description

*Note: I originally submitted this issue in another repository (https://github.com/jupyter/jupyter_core/issues/207), who have suggested that here might be the right place instead. Please let me know if this isn't the right home for it.*

When I try to "Restart and Run All" cells with a notebook containing a `%gui qt` magic, the cells don't execute properly but hang intead.

Related (cc @jni): https://github.com/jupyter/nbclient/issues/97

# How to reproduce
You can reproduce it using [this example gist](https://gist.github.com/GenevieveBuckley/6ad4874a789949e9039becf783716bf4), and clicking "Restart & Run All".

Here's the version numbers of the most relevant packages in my environment:
```
ipykernel 5.3.4 pypi_0 pypi
ipython 7.19.0 pypi_0 pypi
ipython-genutils 0.2.0 pypi_0 pypi
jupyter 1.0.0 pypi_0 pypi
jupyter-book 0.8.3 pypi_0 pypi
jupyter-cache 0.4.1 pypi_0 pypi
jupyter-client 6.1.7 pypi_0 pypi
jupyter-console 6.2.0 pypi_0 pypi
jupyter-core 4.6.3 pypi_0 pypi
jupyter-sphinx 0.3.2 pypi_0 pypi
jupyterlab-pygments 0.1.2 pypi_0 pypi
matplotlib 3.3.2 pypi_0 pypi
nbclient 0.5.0 pypi_0 pypi
nbconvert 5.6.1 pypi_0 pypi
nbformat 5.0.7 pypi_0 pypi
numpy 1.19.2 pypi_0 pypi
pyqt5 5.14.2 pypi_0 pypi
pyqt5-sip 12.8.1 pypi_0 pypi
```

## What happened
The last cell hangs, and never produces the matplotlib graph. Here's a screenshot:

jupyter-notebook-restatrt-and-run-all

## What I expected to happen instead
I expected the notebook output to be the same as when I individually run each notebook cell in order.

jupyter-notebook-manual-run-all-cells

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.