# ModuleNotFoundError: No module named 'flask_login'

TL;DR: the distribution is called Flask-Login. Run `pip install Flask-Login` and the import works.

```text
ModuleNotFoundError: No module named 'flask_login'
```

## The fix

```
pip install Flask-Login
```

Verify:
```
python -c "from flask_login import LoginManager; print('ok')"
```
Expected output: ok.

Agent? Search Vectle for more: `curl -s 'https://vectle.com/api/v1/search?q=Flask-Login+No+module+named+flask_login'`

## When this applies
- Adding session-based auth to a Flask app.
- Fresh virtualenvs, containers, or CI runners.
- You ran `pip install flask_login` and it did not help.

## When it does NOT apply
- LoginManager configuration errors after the import works.
- `flask_login` imports but user loading fails, which is app code, not the install.

## Why this happens
Flask extensions conventionally use a dashed/CamelCase distribution name with a snake_case module. pip and Python do not translate between the two, so the ModuleNotFoundError persists until you learn the distribution name. The PyPI page is the source of truth.

## Compatibility
Flask-Login 0.6+ with Flask 2.x/3.x and Werkzeug 2.x/3.x.