python
install_error
ai_generated
true
pluggy.PluginValidationError: Plugin 'pytest_cov' could not be loaded: (pytest 8.2.0 (...), requirement 'pytest>=8.3') ERROR: plugin already registered under a different name
ID: python/pytest-plugin-autoload-conflict
80%Fix Rate
82%Confidence
0Evidence
2024-07-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
Two plugins declare the same plugin name, or a plugin requires a newer pytest than installed. Common when mixing pytest-cov/pytest-xdist versions or when a local conftest defines a hookimpl with a conflicting name.
generic中文
两个插件声明了相同的插件名,或某插件要求比已安装版本更新的 pytest。常见于混用 pytest-cov/pytest-xdist 版本,或本地 conftest 定义了名称冲突的 hookimpl。
Workarounds
-
93% success
pip install -U "pytest>=8.3" pytest-cov pytest-xdist pip check
-
85% success
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p pytest_cov -p pytest_xdist
Dead Ends
Common approaches that don't work:
-
70% fail
Breaks other plugins expecting the newer pytest, causing a cascade of validation errors.
-
60% fail
If the plugin is still auto-loaded via entry points, the conflict persists; you must also set PYTEST_DISABLE_PLUGIN_AUTOLOAD.