python
config_error
ai_generated
true
错误:无效的要求:'package==1.0+local'(来自 requirements.txt 第 1 行)
ERROR: Invalid requirement: 'package==1.0+local' (from line 1 of requirements.txt)
ID: python/pip-install-error-local-version-identifier
80%修复率
83%置信度
0证据数
2025-06-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.7 | active | — | — | — |
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
根因分析
要求指定了本地版本标识符(例如 1.0+local),除非包来自本地索引或直接 URL,否则在 requirements 文件中不允许使用。
English
The requirement specifies a local version identifier (e.g., 1.0+local) which is not allowed in requirements files unless the package is available from a local index or direct URL.
解决方案
-
85% 成功率
Specify the package with a direct URL: package @ https://example.com/package-1.0+local.tar.gz.
-
80% 成功率
Use a local index: pip install --index-url file:///path/to/index package==1.0+local.
无效尝试
常见但无效的做法:
-
70% 失败
May install a different version than intended, causing compatibility issues.
-
90% 失败
Does not affect local version identifiers; still invalid.