# sqlalchemy.exc.InvalidRequestError: When initializing mapper Mapper[User(users)], expression 'addresses' failed to locate a name

- **ID:** `python/sqlalchemy-exc-invalid-request-relationship-not-loaded`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A relationship attribute in the ORM model references another class or attribute that is not defined or imported correctly.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Import target class before usage** (95% success)
   ```
   Ensure the referenced class is imported and defined before the model using it, e.g., from models import Address.
   ```
2. **Use string reference for relationship** (90% success)
   ```
   Use string-based relationship targets like 'Address' if the class is defined later in the same module.
   ```

## Dead Ends

- **Renaming the attribute only** —  (60% fail)
- **Deleting the relationship** —  (50% fail)
