## TL;DR
Run `python -m pip install pytest-cov`. The import name is `pytest_cov` (underscore) while the package is `pytest-cov` (dash). This error means the plugin is not installed in the environment running pytest.

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

## Fix it

1. **Install the plugin.** Run `python -m pip install pytest-cov`.
   - Expected: `Successfully installed pytest-cov-...`.

2. **Verify it loads.** Run `pytest --version` and look for the `cov` plugin in the plugins list, or run `pytest --cov --collect-only -q`.
   - Expected: no ModuleNotFoundError; coverage options are accepted.

## When this applies
- You use `--cov` flags but never installed the plugin in this environment.
- CI installs pytest but the coverage step assumes pytest-cov is present.

## When it does not apply
- If `--cov` is accepted but coverage import errors mention `coverage.results` or `coverage.report`, that is a version mismatch, not a missing install.

## Tool compatibility
pytest-cov 4.x/5.x/6.x with pytest 7/8, Python 3.8+.

## Why it happens
`--cov` is not built into pytest; it comes from the pytest-cov plugin. Without the plugin installed, anything importing `pytest_cov` fails.

## Edge cases
- Remember the dash/underscore split: `pip install pytest-cov`, `import pytest_cov`.
