python 故障1:安装库的时候,使用pip相关命令报错:XXX Read timed out. XXX ,下载安装太慢了,如何更快?
·
现象:
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 2
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
解决办法:
这个错误是由于网络连接超时导致的,在安装 Python 包时经常会遇到。以下是解决方案:
一、更换 pip 源(推荐)
国内访问 Python 官方源 (pypi.org) 速度较慢,容易超时。可以临时使用国内镜像源:
pip install svglib reportlab -i https://pypi.tuna.tsinghua.edu.cn/simple
常用的国内镜像源:
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:https://mirrors.aliyun.com/pypi/simple/
豆瓣:https://pypi.doubanio.com/simple/
然后,在powershell管理员模式下输入命令,安装效果如下:
如下即代表安装成功了
更多推荐
所有评论(0)