ipython / ipython/ipykernel

RuntimeError: There is no current event loop in thread 'MainThread'

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

描述

While trying to update ipykernel's Debian package to 6.13.0, tests were failing with the above error.

I got out of this with:
```
--- ipykernel.orig/ipykernel/inprocess/client.py
+++ ipykernel/ipykernel/inprocess/client.py
@@ -179,8 +179,7 @@
stream = kernel.shell_stream
self.session.send(stream, msg)
msg_parts = stream.recv_multipart()
- loop = asyncio.get_event_loop()
- loop.run_until_complete(kernel.dispatch_shell(msg_parts))
+ asyncio.run(kernel.dispatch_shell(msg_parts))
idents, reply_msg = self.session.recv(stream, copy=False)
self.shell_channel.call_handlers_later(reply_msg)
```

but I'm not sure it's a good solution...

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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