TL;DR: statsmodels needs the patsy package for formula support and it is not installed. Run `pip install patsy` and the import works.

## The error
```text
ModuleNotFoundError: No module named 'patsy'
```

## Fix it
1. Install patsy:
   ```
   pip install patsy
   ```
   Expected: install completes.
2. Verify:
   ```
   python -c "import statsmodels.formula.api as smf; print('ok')"
   ```
   Expected: prints ok.

## When this applies
Use this when importing statsmodels (or fitting a model from a formula string like "y ~ x") raises the patsy error.

## When it does not apply
If you never use formulas, plain statsmodels imports may work without patsy; the error only bites formula code paths. If patsy is installed but the import still fails, check your environment.

## Compatibility
All statsmodels versions; patsy has always been the formula dependency.

## Root cause
statsmodels keeps patsy as an optional-at-install dependency because only the formula API needs it. Minimal installs and --no-deps installs skip it, and the first formula use fails.

## Edge cases
In conda envs, install patsy from the same channel as statsmodels. Some very old statsmodels pins pair with patsy versions that need matching; upgrading both together is safest.