我正在尝试更新 pip,但我不断收到以下消息:
H:\>python -m pip install -U pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.con
nection.VerifiedHTTPSConnection object at 0x031AF3B0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.con
nection.VerifiedHTTPSConnection object at 0x031AF3D0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.con
nection.VerifiedHTTPSConnection object at 0x031AF110>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.con
nection.VerifiedHTTPSConnection object at 0x031AF0B0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.con
nection.VerifiedHTTPSConnection object at 0x031AF170>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/
Requirement already up-to-date: pip in c:\users\a256886\appdata\local\programs\python\python36-32\lib\site-packages
我安装了 python 3.6.1,当我运行 pip --version 我看到 pip 9.0.1。
为什么我不能更新?或者使用 pip 安装任何软件包?怎么了?我该如何解决?
最佳答案
你在代理后面。正如您所发现的,您可以将代理传递给 pip
使用 --proxy
争论:
python -m pip install -U pip --proxy http://username:password@proxy_url:port
或者
pip install --upgrade pip --proxy http://username:password@proxy_url:port
该文档在这里令人困惑,因为它没有提到将协议(protocol)作为代理定义的一部分传递的要求。
关于python -m pip install -U pip Errno 11004,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44950994/