如下:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
报错如下:
错误一:
ERROR: Exception:
......
socket.timeout: The read operation timed out
......
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 442, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out.
错误二:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out. (read timeout=15)")': /simple/certifi/
解决:
设置默认的超时时间
pip install -r requirements.txt -i https://pypi.tun