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

其他格式: JSON · Markdown 中文 · English
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.

generic

解决方案

  1. 70% 成功率
    Contact the package maintainer to fix the metadata. As a temporary workaround, install with --no-deps and manually install dependencies.
  2. 90% 成功率
    If you control the package, correct the environment marker in setup.py (e.g., ensure it ends with a valid expression) and rebuild.

无效尝试

常见但无效的做法:

  1. 80% 失败

    The malformed marker prevents proper dependency resolution; force install may skip dependencies.

  2. 85% 失败

    The issue is in the package's metadata, not the packaging library.