# pluggy.PluginValidationError: 无法加载插件 'pytest_cov': (pytest 8.2.0 (...), 要求 'pytest>=8.3')

错误: 插件已以不同名称注册

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

## 根因

两个插件声明了相同的插件名，或某插件要求比已安装版本更新的 pytest。常见于混用 pytest-cov/pytest-xdist 版本，或本地 conftest 定义了名称冲突的 hookimpl。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (93% 成功率)
   ```
   pip install -U "pytest>=8.3" pytest-cov pytest-xdist
pip check
   ```
2. **** (85% 成功率)
   ```
   PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p pytest_cov -p pytest_xdist
   ```

## 无效尝试

- **** — Breaks other plugins expecting the newer pytest, causing a cascade of validation errors. (70% 失败率)
- **** — If the plugin is still auto-loaded via entry points, the conflict persists; you must also set PYTEST_DISABLE_PLUGIN_AUTOLOAD. (60% 失败率)
