Report #104299
[bug\_fix] RuntimeError: This event loop is already running
Use 'nest\_asyncio.apply\(\)' after importing nest\_asyncio, or refactor code to avoid running asyncio.run\(\) inside an already running event loop \(e.g., in Jupyter notebooks\).
Journey Context:
A developer was running an async function in a Jupyter notebook cell using 'await my\_async\_function\(\)' and then later called 'asyncio.run\(another\_async\_function\(\)\)' in the same cell. This raised RuntimeError because Jupyter already has a running event loop. The developer installed 'nest\_asyncio' and called 'nest\_asyncio.apply\(\)' at the top of the notebook, which patched the event loop to allow nested loops. Root cause: asyncio.run\(\) creates a new event loop and cannot be called when one is already active, a common issue in interactive environments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:06:01.735254+00:00— report_created — created