Jupyter notebook runs as a tornado web server. Your browser connect to this tornado server via a socket.
The I/O of the socket are handled by tornado's asyncio, which relies on the add_reader
implementation of the native asyncio module of python runtime. As pointed out in the documentation of asyncio
, this method is only supported with Windows SelectorEventLoop so make sure you are using this kind of event loop in your python installation. To find out which eventloop implementation is in usage, you can run the following commands in python shell:
import asyncio
print(asyncio.get_event_loop().__class__)
# Output: <class 'asyncio.windows_events._WindowsSelectorEventLoop'>
There is an ongoing discussion about allowing user to change the EventLoopPolicy
of asyncio in jupyter's configuration file.