This event loop is already running

在jupyter notebook中使用asyncio包时,会发生

This event loop is already running

的错误。
解决办法是安装nest_asyncio

pip install nest_asyncio

并在导入前调用

import nest_asyncio
nest_asyncio.apply()

你可能感兴趣的:(python,python)