# CoverageFailure: Could not import module 'my_module' for coverage measurement

- **ID:** `python/pytest-cov-import-error`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest-cov cannot import the specified module, likely because it is not installed or not in the Python path.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Run `python -c "import my_module"` to verify the module is importable, then adjust PYTHONPATH if needed.
   ```
2. **** (85% success)
   ```
   Specify the full package path: `pytest --cov=src/my_module` or use `--cov=my_package.my_module`
   ```

## Dead Ends

- **** — The module might already be installed in a different environment; the issue is often path-related rather than installation. (50% fail)
- **** — The module might be in a subpackage; coverage requires the full dotted path. (70% fail)
