# 插件验证错误：未找到插件 'pytest-html'

- **ID:** `python/pytest-missing-plugin-dependency`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在 conftest.py 或命令行中指定的 pytest 插件未在当前 Python 环境中安装。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## 解决方案

1. **Install the missing plugin using pip.** (95% 成功率)
   ```
   pip install pytest-html
   ```
2. **Add the plugin to requirements.txt and run pip install -r requirements.txt.** (90% 成功率)
   ```
   echo 'pytest-html' >> requirements.txt && pip install -r requirements.txt
   ```

## 无效尝试

- **Manually copying plugin files to the project directory** — Plugins must be installed via pip to be properly registered with pytest. (85% 失败率)
- **Removing the plugin reference from conftest.py without installing** — If the plugin is required for test functionality, tests may fail or behave incorrectly. (60% 失败率)
