【发布时间】:2019-01-22 09:43:28
【问题描述】:
我的组织使用 artifactory,一个本地包存储库管理器。 Artifactory 提供了一个名为 Remote Repositories 的功能,它为远程存储库提供代理和缓存功能,我们使用它来代理和缓存对 PyPi 的访问(有关更多详细信息,请参阅PyPi Repositories)。
为了使用这个远程存储库,必须向 pip.conf 添加一个条目。我已经在一个需要安装一些机器的盒子上完成了这项工作,但是当我发出 pip 命令(在我的情况下是 sudo -E pip install --ignore-installed pip setuptools wheel)时,pip 似乎忽略了 pip.conf 中的内容,而是试图到达 @987654322 @。
这是我刚刚运行的记录:
$ cat /etc/pip.conf
[global]
index-url = https://username:password@artifactory.myorg.com/artifactory/api/pypi/pypi-remote/simple
$ sudo -E pip
install --ignore-installed pip setuptools wheel
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /home/jamiet/.pip/pip.log
$ cat /home/jamiet/.pip/pip.log
Downloading/unpacking pip
Getting page https://pypi.python.org/simple/pip/
Could not fetch URL https://pypi.python.org/simple/pip/: connection error: ('Connection aborted.', error(101, 'Network is unreachable'))
Will skip URL https://pypi.python.org/simple/pip/ when looking for download links for pip
Getting page https://pypi.python.org/simple/ Could not
fetch URL https://pypi.python.org/simple/: connection error:
('Connection aborted.', error(101, 'Network is unreachable'))
Will skip URL https://pypi.python.org/simple/ when looking for download
links for pip
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for pip:
* https://pypi.python.org/simple/pip/
Getting page https://pypi.python.org/simple/pip/
Could not fetch URL https://pypi.python.org/simple/pip/: connection error: ('Connection
aborted.', error(101, 'Network is unreachable'))
Will skip URL https://pypi.python.org/simple/pip/ when looking for download link for pip
Could not find any downloads that satisfy the requirement pip
Cleaning up... No distributions at all found for pip
当 pip.conf 指示它去其他地方时,谁能向我解释为什么 pip 试图到达 https://pypi.python.org/simple/pip/?
【问题讨论】:
-
请对日志使用代码格式,而不是
<blockquote> -
明白了,非常感谢您花时间修改它。
-
我只是猜测,如果您将它与
sudo一起使用,那么可能在root用户配置中存在覆盖site-wide配置的配置。配置按给定顺序读取site -> user -> venv并且您正在设置配置文件只是为了覆盖站点 -
这是可能的。我会调查一下。谢谢。
-
刚刚意识到这个 VM 上使用的默认 pip 版本是 1.5.6,它于 2014 年 5 月发布,这让我觉得有点老了。这个版本可能不支持 pip.conf 吗?