# RuntimeError: Task got Future attached to a different loop

- **ID:** `python/asyncio-task-got-future-different-loop`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A coroutine or Future created under one event loop was awaited on another loop, e.g. by calling asyncio.run() twice or mixing loop.run_until_complete() with asyncio.run().

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())  # single entry point
   ```
2. **** (90% success)
   ```
   # In Jupyter/IPython or uvicorn, just 'await main()'
# Do NOT call asyncio.run() inside an already-running loop
   ```

## Dead Ends

- **** — The Future object still references the original loop; identity mismatch remains. (85% fail)
- **** — ensure_future still binds to the current loop, not the Future's original loop. (80% fail)
