ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

asyncio.run() cannot be called from a running event loop的解决方法

asyncio.run() cannot be called from a running event loop的解决方法

# Run the agent
asyncio.run(main())

报错:

asyncio.run() cannot be called from a running event loop

 
import nest_asyncio
import asyncio
 
nest_asyncio.apply()
await main()
 
 
另外关于python async的介绍:
https://docs.llamaindex.org.cn/en/stable/getting_started/async_python/
 
 
 

返回列表