pip安装请求错误

问题描述 投票:0回答:3

尝试安装请求,收到以下错误消息。我还尝试手动下载它们并根据本地文件运行相同的代码,但我遇到了同样的问题。我不认为它在请求方面,因为如果我尝试通过pip下载任何内容,我会得到相同的错误消息。

C:\Users\212615669>pip install requests
Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x031251D0>: Failed to establish a new c
onnection: [Errno 11004] getaddrinfo failed',)': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03125190>: Failed to establish a new c
onnection: [Errno 11004] getaddrinfo failed',)': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03125090>: Failed to establish a new c
onnection: [Errno 11004] getaddrinfo failed',)': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03121FD0>: Failed to establish a new c
onnection: [Errno 11004] getaddrinfo failed',)': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec
tion broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.conne
ction.VerifiedHTTPSConnection object at 0x03121EB0>: Failed to establish a new c
onnection: [Errno 11004] getaddrinfo failed',)': /simple/requests/
  Could not find a version that satisfies the requirement requests (from version
s: )
No matching distribution found for requests
python installation pip python-requests
3个回答
0
投票
sudo -H pip install requests --proxy="my_proxy_name:port"

试试这个


0
投票

简单的方法是提供代理信息。

 pip install --proxy=user:pass@server:port requests

第二种方法是使用导出代理设置

set http_proxy=http://username:password@proxyAddress:port
set https_proxy=https://username:password@proxyAddress:port
pip install requests

0
投票

这种情况发生在我身上,我启动了一个Vagrant虚拟机,即当互联网出现故障时通过vagrant up。我想,在它恢复之后,网络设置从未更新过。

我所要做的就是暂停VM并重新启动它。问题消失了。

也许这有助于某人。

© www.soinside.com 2019 - 2024. All rights reserved.