安装python第三方库时,出现超时错误(socket.timeout: The read operation timed out和pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.)
原因:国内网络下载python包很慢,需要自己控制超时
解决方案: 如设置 default-timeout为1000,命令如下
pip install --default-timeout=10000 cryptography