# AttributeError: module 'sqlalchemy.orm' has no attribute 'sessionmaker'

- **ID:** `python/sqlalchemy-missing-sessionmaker`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Importing sessionmaker incorrectly, e.g., from sqlalchemy.orm import sessionmaker is correct, but some may do from sqlalchemy import orm and then orm.sessionmaker which doesn't exist.

## Version Compatibility

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

## Workarounds

1. **** (100% success)
   ```
   Import correctly: from sqlalchemy.orm import sessionmaker
   ```
2. **** (100% success)
   ```
   Use Session = sessionmaker(bind=engine) after correct import.
   ```

## Dead Ends

- **** — sessionmaker is not in the top-level sqlalchemy namespace; it's in sqlalchemy.orm. (90% fail)
- **** — The correct name is sessionmaker (no underscore). (80% fail)
