# RuntimeError: This event loop is already running

- **ID:** `python/asyncio-event-loop-already-running`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Calling asyncio.run() or loop.run_until_complete() from within an already-running event loop, e.g. inside a Jupyter notebook, an async function, or a framework that already owns the loop.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   import nest_asyncio
nest_asyncio.apply()
asyncio.run(main())
   ```
2. **** (95% success)
   ```
   async def outer():
    await main()  # instead of asyncio.run(main())
   ```

## Dead Ends

- **** — Stopping the loop corrupts the outer framework's scheduling and causes pending tasks to hang. (85% fail)
- **** — Creates a nested loop that cannot await futures belonging to the outer loop; raises 'attached to a different loop'. (70% fail)
