# RuntimeError: asyncio.run() cannot be called from a running event loop

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

## Root Cause

asyncio.run() was called from inside an already-running loop, common in Jupyter notebooks, IPython, or async frameworks.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8+ | active | — | — |
| 3.9+ | active | — | — |
| 3.10+ | active | — | — |
| 3.11+ | active | — | — |
| 3.12+ | active | — | — |

## Workarounds

1. **** (97% success)
   ```
   # In a Jupyter cell:
await main()
# Do NOT use asyncio.run() in Jupyter
   ```
2. **** (95% success)
   ```
   task = asyncio.create_task(main())
await task
   ```

## Dead Ends

- **** — Nest_asyncio patches the loop but breaks some libraries and can deadlock; often produces subtle bugs. (55% fail)
- **** — Raises the same error because the loop is already running. (90% fail)
