ipython / ipython/ipykernel

ipykernel disallows jupyter user to create/attach to event loop

Đang mở
#548 8 bình luận 9 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

Hello,

as follow-up on https://github.com/jupyter/notebook/issues/3397#issuecomment-419474214, here a minimal example that I expect to finish successfully when sent to the kernel by jupyter:

```py
import asyncio
print(asyncio.get_event_loop().run_until_complete(asyncio.sleep(0)))
```

It runs fine in latest IPython which doesn't use tornado under the hood.

However, `notebook>=5.7.9` requires `tornado>=5` and so when ipykernel executes `loop = tornado.ioloop.IOLoop.current()`, an asyncio event loop will be created and `run_forever` by ipykernel.

This consequently leaves the user without options (left aside `nest-asyncio` which works for most cases), as there is a running asyncio loop on startup.

If IPython can run this simple snippet, shouldn't jupyter be able to do the same? Currently, any package that does a plain loop setup and teardown will crash in jupyter envs that have `tornado>=5`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.