Discuss / Python / 在jupyter notebook中运行出现RuntimeError: This event loop is already running

在jupyter notebook中运行出现RuntimeError: This event loop is already running

Topic source

不过例程在出现错误后,还可以运行,打印出正确结果。

将相应例程保存成.py文件,在命令行运行就可以了。只是要注意文件名不能采用asyncio.py,存成这个会出现AttributeError: module 'threading' has no attribute 'correntThread'。网上查了一下,是由于自己的文件名跟库名重复了,系统在这个本地文件中查找不到属性。将文件名修改成asyncio1.py,asyncio2.py之类的,再运行就好了。


  • 1

Reply