尝试安装请求,收到以下错误消息。我还尝试手动下载它们并根据本地文件运行相同的代码,但我遇到了同样的问题。我不认为它在请求方面,因为如果我尝试通过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
答案 0 :(得分: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
答案 1 :(得分:0)
sudo -H pip install requests --proxy="my_proxy_name:port"
试试这个
答案 2 :(得分:0)
这发生在我启动的开发Vagrant虚拟机上(例如,在互联网中断时通过vagrant up
启动。我猜想,它在重新启动后就从未更新过网络设置。) >
我要做的就是停止VM并重新启动它。问题解决了。
也许这可以帮助某人。