Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 23
    I consider this not to be good advice. There is no explanation about what this code does, why it even solves the problem and what side effects it might have. Commented May 11, 2021 at 9:28
  • 7
    Citing nest_asyncio: By design asyncio does not allow its event loop to be nested. This presents a practical problem: When in an environment where the event loop is already running it’s impossible to run tasks and wait for the result. Trying to do so will give the error “RuntimeError: This event loop is already running”. ... This module patches asyncio to allow nested use of asyncio.run and loop.run_until_complete. Source: pypi.org/project/nest-asyncio Commented Aug 25, 2021 at 13:28