# sqlalchemy.exc.UnboundExecutionError: Could not locate a bind configured on mapper, SQL expression, or this Session.

- **ID:** `python/sqlalchemy-missing-session-bind`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

会话或引擎未正确绑定到数据库，无法执行 SQL。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.4.x | active | — | — |
| 2.0.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   创建会话时绑定引擎：Session = sessionmaker(bind=engine)
   ```
2. **** (85% success)
   ```
   在查询时指定 bind：session.execute(stmt, bind=engine)
   ```

## Dead Ends

- **** — 尝试使用默认会话，但未配置引擎。 (80% fail)
- **** — 在会话中手动添加 bind，但可能与其他配置冲突。 (50% fail)
