python
config_error
ai_generated
partial
pkg_resources.extern.packaging.requirements.InvalidRequirement: 无效的环境标记:python_version >= '3.7' and
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid environment marker: python_version >= '3.7' and
ID: python/setuptools-invalid-environment-marker
80%修复率
83%置信度
0证据数
2024-10-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.7 | active | — | — | — |
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
根因分析
包的元数据包含格式错误的环境标记,通常是由于 'and' 或 'or' 后缺少操作数。这可能发生在手动编辑 setup.py 或打包工具存在 bug 时。
English
A package's metadata contains a malformed environment marker, typically due to a missing operand after 'and' or 'or'. This can happen with hand-edited setup.py or a bug in packaging tools.
解决方案
-
70% 成功率
Contact the package maintainer to fix the metadata. As a temporary workaround, install with --no-deps and manually install dependencies.
-
90% 成功率
If you control the package, correct the environment marker in setup.py (e.g., ensure it ends with a valid expression) and rebuild.
无效尝试
常见但无效的做法:
-
80% 失败
The malformed marker prevents proper dependency resolution; force install may skip dependencies.
-
85% 失败
The issue is in the package's metadata, not the packaging library.