ipython / ipython/ipykernel

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

未关闭
#559 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
734
派生
412
平均合并
1 天 5 小时
30 天内合并 PR
8

描述

# 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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。