python
config_error
ai_generated
true
WARNING: mypkg 1.0 does not provide the extra 'dev'
ID: python/setuptools-missing-extras-requires
80%Fix Rate
86%Confidence
0Evidence
2024-06-08First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The package metadata does not declare the requested extra in extras_require or [project.optional-dependencies], so pip installs only the base package.
generic中文
包元数据未在 extras_require 或 [project.optional-dependencies] 中声明所请求的额外项,因此 pip 仅安装基础包。
Workarounds
-
90% success
pip install mypkg pytest ruff mypy
-
85% success
# in pyproject.toml [project.optional-dependencies] dev = ["pytest", "ruff"] pip install -e '.[dev]'
Dead Ends
Common approaches that don't work:
-
90% fail
--pre enables pre-releases but does not create extras that are not declared.
-
85% fail
Upgrading does not add extras to the metadata; the warning persists.
-
70% fail
If 'all' is not declared either, the same warning appears for 'all'.