这是我尝试通过pip3(版本10.0.1)安装awscli时遇到的错误。
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ProtocolError('Connection aborted.',
OSError(0, 'Error'))': /simple/awscli/
Could not find a version that satisfies the requirement awscli (from versions: )
No matching distribution found for awscli
当我尝试以下命令时,出现与上述相同的错误:
pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org awscli
我将不胜感激。谢谢!
答案 0 :(得分:1)
在这种情况下,问题在于本地有另一个程序正在运行,该程序正在端口443
上接收所有请求。 cURL请求失败,并显示以下错误:
Unknown SSL protocol error in connection to pypi.org:443
,但这是因为它使用127.0.0.1
进行连接。
Trying 151.101.0.223... * TCP_NODELAY set * Connected to pypi.org (127.0.0.1) port 443 (#0) * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /Users/lillymcleod/anaconda/ssl/cacert.pem CApath: none * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client hello (1): * Unknown SSL protocol error in connection to pypi.org:443 * Curl_http_done: called premature == 0 * Closing connection 0
这篇帖子https://superuser.com/questions/1045431/curl-connecting-to-localhost-127-0-0-1-instead-of-destination-ip对于使用以下命令确定正在运行哪个程序很有帮助:
# Finds the ports receiving requests
nc -v -w 2 YOUR_DOMAIN_HERE YOUR_PORT_HERE
# Find the applications running on the ports
nettop -nm tcp
一旦应用程序被杀死,pip install命令将再次按预期工作。