安装pip或者更新pip如果网络情况不好的情况下:
socket.timeout: The read operation timed out
# ---------------------------------
pip._vendor.urllib3.exceptions.ReadTimeoutError:
HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
这是我们可将pip的源头改为国内的源:
只需要在原来的pip语句后,用-i指定执行源即可:
python -m pip install --upgrade pip -i https://mirror.baidu.com/pypi/simple
此处为指定为百度的源,也可以改为清华源等等