# ImportError: No module named 'flask_sqlalchemy'

- **ID:** `python/flask-import-error-flask-sqlalchemy-not-installed`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Flask-SQLAlchemy extension is not installed in the environment.

## Version Compatibility

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

## Workarounds

1. **Install Flask-SQLAlchemy** (95% success)
   ```
   pip install flask-sqlalchemy
# Then import: from flask_sqlalchemy import SQLAlchemy
   ```
2. **Use virtual environment and install** (90% success)
   ```
   python -m venv venv
source venv/bin/activate
pip install flask flask-sqlalchemy
   ```

## Dead Ends

- **Installing with pip install flask-sqlalchemy but using wrong import name** — Import name is flask_sqlalchemy, not flask-sqlalchemy. (70% fail)
- **Assuming it's included with Flask** — Flask-SQLAlchemy is a separate package. (80% fail)
