一、问题描述
PyCharm下载模块报错,报错信息为:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
二、原因
网络速度慢、需下载的模块很大,导致下载超时。
三、解决办法
下载模块的同时设置超时时间
pip --default-timeout=1000 install -U requests
两个参数:
timeout是超时时间,根据自己的需要进行修改;
requests是需要下载的模块,替换成自己正在下载的模块即可。