python config_error ai_generated true

错误:选项 --extra-index-url 需要一个参数

ERROR: option --extra-index-url requires an argument

ID: python/pip-option-requires-argument

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2024-09-14首次发现

版本兼容性

版本状态引入弃用备注
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

根因分析

使用了 --extra-index-url 标志但未提供 URL 值。

English

The --extra-index-url flag was used without providing a URL value.

generic

解决方案

  1. 95% 成功率
    pip install package --extra-index-url https://private-pypi.example.com/simple
  2. 90% 成功率
    export PIP_EXTRA_INDEX_URL=https://private-pypi.example.com/simple && pip install package

无效尝试

常见但无效的做法:

  1. 80% 失败

    Pip will try to use that URL and fail to connect.

  2. 50% 失败

    The package may not be found without the extra index.