python install_error ai_generated true

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

PluginValidationError: plugin 'pytest-html' not found

ID: python/pytest-missing-plugin-dependency

其他格式: JSON · Markdown 中文 · English
80%修复率
84%置信度
0证据数
2024-01-20首次发现

版本兼容性

版本状态引入弃用备注
3.9 active
3.10 active
3.11 active

根因分析

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

English

A pytest plugin specified in conftest.py or command line is not installed in the current Python environment.

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. Manually copying plugin files to the project directory 85% 失败

    Plugins must be installed via pip to be properly registered with pytest.

  2. Removing the plugin reference from conftest.py without installing 60% 失败

    If the plugin is required for test functionality, tests may fail or behave incorrectly.