# Failed: [doctest] mymodule.func
UNEXPECTED EXCEPTION: ModuleNotFoundError: No module named 'mymodule'

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

## Root Cause

pytest-doctest tries to import the module from the doctest file, but the module is not on sys.path because tests run from a different directory.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   pip install -e .
pytest --doctest-modules
   ```
2. **** (90% success)
   ```
   In pytest.ini: `[pytest]
pythonpath = .`
   ```

## Dead Ends

- **** — May work locally but fails in CI where the working directory differs. (60% fail)
- **** — Loses doctest coverage; not a fix. (80% fail)
