# FileNotFoundError: [Errno 2] No such file or directory: 'report.html'

- **ID:** `python/pytest-html-report-not-generated`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest-html plugin did not generate the report file, often because the plugin is not installed, the output path is incorrect, or the test run crashed before report generation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   pip install pytest-html
pytest --html=report.html --self-contained-html
   ```
2. **** (88% success)
   ```
   import tempfile
import os

report_path = os.path.join(tempfile.gettempdir(), 'report.html')
# Run pytest with: --html=report_path
   ```

## Dead Ends

- **** — This creates an empty file that does not contain test results. The report will be useless. (95% fail)
- **** — This avoids the error but does not generate the report, defeating the purpose of using pytest-html. (90% fail)
