Notebook: asyncio.run() fails in the notebook

Created on 3 Jan 2019  路  3Comments  路  Source: jupyter/notebook

Problem

I cannot run in the notebook a demo from the asyncio docs:

2019-01-02 23_08_03-untitled

Observation

It does seem to run in ipython:

2019-01-02 23_06_19-cmder

Setup

I've installed a new everything on a fresh install of Windows 10.
I am running Python 3.7 via Anaconda 2018.12.

conda                     4.5.12                   py37_0
ipykernel                 5.1.0            py37h39e3cac_0
ipython                   7.2.0            py37h39e3cac_0
jupyter                   1.0.0                    py37_7
jupyter_client            5.2.4                    py37_0
notebook                  5.7.4                    py37_0

Most helpful comment

Yes, it is a known limitation.
You need to use things like nest-async-io. This is documented here.

You should be able to just await main()

All 3 comments

cc @Carreau

Yes, it is a known limitation.
You need to use things like nest-async-io. This is documented here.

You should be able to just await main()

I'm going to close as I'm not sure there is much we can do as nesting event loop is a bad idea.
Feel free to keep commenting or ask for a re-open.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uolter picture uolter  路  3Comments

mowe96 picture mowe96  路  3Comments

ehossain1982 picture ehossain1982  路  3Comments

qnicole-zakka picture qnicole-zakka  路  3Comments

mikepqr picture mikepqr  路  3Comments