1
我在debian chroot中使用pip。我將/etc/resolv.conf從主機複製到chroot。我可以ping通www.google.com和其他網站。使用pip時獲取ConnectionError
當我在chroot中運行pip search pyopenssl時,出現以下錯誤。
File "/usr/local/lib/python2.7/site-packages/pip/utils/outdated.py", line 122, in pip_version_check
headers={"Accept": "application/json"},
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 373, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 424, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/pip/json (Caused by ProtocolError('Connection aborted.', error(0, 'Error')))
Starting new HTTPS connection (1): pypi.python.org
Incremented Retry for (url='/pypi'): 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(0, 'Error'))': /pypi
Starting new HTTPS connection (2): pypi.python.org
你能夠捲曲到URL嗎? – SuperSaiyan
我可以ping pypi.python.org。運行curl -X GET pypi.python.org/pypi或curl -X GET curl -X GET pypi.python.org不返回 –
curl -L -X GET https://pypi.python.org使用https遵循重定向和獲取源代碼。 –