# ModuleNotFoundError: No module named 'starlette'

- **ID:** `python/starlette-import-error-no-module-named-starlette`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Starlette is not installed in the current Python environment.

## Version Compatibility

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

## Workarounds

1. **Install Starlette using pip.** (95% success)
   ```
   pip install starlette
   ```
2. **Install FastAPI which includes Starlette.** (90% success)
   ```
   pip install fastapi
   ```

## Dead Ends

- **Installing starlette with pip but using a virtual environment not activated.** — If the virtual environment is not activated, the package is installed in the system Python, not the project's environment. (80% fail)
- **Assuming starlette is included with FastAPI.** — FastAPI depends on Starlette, but if you install only FastAPI, Starlette is installed as a dependency. However, if you uninstall FastAPI, Starlette may also be removed. (60% fail)
