“Asyncio Event Loop is Closed” when getting loop

On Windows seems to be a problem with EventLoopPolicy, use this snippet to work around it:

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())

Leave a Comment