通过镜像安装
一般情况下pip出现read time-out的情况,是由于我们下载的是国外的包,下载速度较慢,从而导致超时,所以一般遇到这种问题,我们可以选择国内的镜像来解决问题。
比如安装模块scikit-image,一般情况下pip install scikit-image执行安装,因为scikit-image模块存储较大,安装速度很慢,所以会报错read time-out。这时候通过镜像来解决。
常用的有镜像有:
使用镜像的安装范式为:pip install xxxx -i http://… 或者 pip install -i http://… xxxx。
清华大学镜像:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:http://mirrors.aliyun.com/pypi/simple/
中科大镜像:https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣镜像:http://pypi.douban.com/simple/
中科大镜像2:http://pypi.mirrors.ustc.edu.cn/simple/
pip install scikit-image==0.16.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/