Report #103396
[bug\_fix] RuntimeError: asyncio.run\(\) cannot be called from a running event loop
Do not call asyncio.run\(\) when already inside an async function or a running event loop. In notebooks or existing loops, await the coroutine directly. In scripts, keep a single sync entry point that calls asyncio.run\(\) once.
Journey Context:
You write an async helper and call it from a Jupyter cell with asyncio.run\(main\(\)\). The first cell works; the second throws RuntimeError because Jupyter already has a running event loop. You try calling asyncio.run\(\) inside an async function and get the same error. The docs clarify that asyncio.run\(\) creates a new event loop, runs the coroutine, and closes the loop; it cannot be nested. In notebooks you simply 'await main\(\)' instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:20:04.588834+00:00— report_created — created