从本地文件夹进行安装时,PIP防止连接到pypi.python.org

时间:2018-09-25 14:36:26

标签: python python-2.7 pip pypi

在尝试通过如下所示的PIP进行安装

sudo pip install --verbose -U --allow-unverified --no-index --find-links=/tmp/chef-cache/patroni patroni[zookeeper]==1.4.4

我看到pip试图连接到pypi.python.org

Getting page https://pypi.python.org/simple/patroni/
Starting new HTTPS connection (1): pypi.python.org
Incremented Retry for (url='/simple/patroni/'): Retry(total=4, connect=None, read=None, redirect=None)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(99, 'Cannot assign requested address'))': /simple/patroni/
Starting new HTTPS connection (2): pypi.python.org
Incremented Retry for (url='/simple/patroni/'): Retry(total=3, connect=None, read=None, redirect=None)
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(99, 'Cannot assign requested address'))': /simple/patroni/
Starting new HTTPS connection (3): pypi.python.org

该设置无权访问外部IP。有什么方法可以防止点子尝试连接到pypi.python.org吗?

注意-安装进行得很好。但是,由于它尝试连接到pypi.python.org然后超时,因此花费了更多时间,从而减慢了安装速度。

  • pip版本:7.1.2
  • Python版本:2.7.6
  • 操作系统:Ubuntu 14.04

1 个答案:

答案 0 :(得分:0)

这看起来像是PIP 7.1.2的问题。在最新的PIP 18.0中未发现该问题。