【问题标题】:Pip index-url issue with nested dependencies具有嵌套依赖项的 Pip index-url 问题
【发布时间】:2019-08-27 19:38:58
【问题描述】:

我目前在内部服务器上安装了一个 pip 镜像(这是一个离线网络)。访问它的网址是http://pypi.python.org/simple。我在 ~/.pip/pip.conf 创建了一个配置文件,内容如下:

[global]
index-url = http://pypi.python.org/simple
trusted-host = pypi.python.org

我可以成功安装没有嵌套依赖项的包,例如通过执行pip3 install requests。我成功安装了请求、idna、chardet、certifi 和 urllib3 的输出。但是,当我需要从具有嵌套依赖项的 pip 安装某些东西时,例如通过 pip3 install driller,我会得到以下输出:

Collecting driller
  Downloading driller-1.0.tar.gz
Collecting angr (from driller)
  Downloading angr-8.19.2.4.tar.gz (758kB)
  100% |                          | 768kB 75.7MB/s
  Complete output from command python setup.py egg_info:
  Download error on https://pypi.python.org/simple/pyvex/: [Errno 111] Connection refused -- Some packages may not be found!
  ...

让我感到奇怪的是,错误是由于尝试访问 https://pypi.python.org/simple 而发生的,而不是我通过 index-url 在 http://pypi.python.org 指定的本地镜像。此外,如果我执行pip3 install pyvex,它安装得很好。当存在嵌套依赖项时,我是否错过了如何通过 pip install 命令传播我的 index-url/受信任的主机?

【问题讨论】:

标签: python pip offline mirror


【解决方案1】:

我有完全相同的问题,并在StackOverflow 的这个帖子中得到了答案。

这里是解决方案

在您的系统上找到 Python 目录,并将以下两行添加到文件夹 distutils 中的 distutils.cfg 中。如果配置文件尚不存在,则创建它。

[easy_install]
index_url = blablabla

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-30
    • 2020-06-24
    • 1970-01-01
    • 1970-01-01
    • 2020-05-12
    • 2012-11-15
    • 2011-11-25
    • 2020-02-11
    相关资源
    最近更新 更多