安装Python包时特别慢,超时失败怎么办?如何切换Python安装源?
在安装Python包时特别慢,速度只有几K,经常超时失败。而且还有可能链接不上。
今天银狐教大家换源,使用国内的镜像源安装,就是换镜像源。
在安装时在命令里加一个参数 -i,然后在i后面加国内镜像地址。
代码:
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple/
部分国内镜像地址,有如下镜像可供选择:
阿里云 [http://mirrors.aliyun.com/pypi/simple/]
中国科技大学 [https://pypi.mirrors.ustc.edu.cn/simple/]
豆瓣(douban) [http://pypi.douban.com/simple/]
清华大学 [https://pypi.tuna.tsinghua.edu.cn/simple/]
中国科学技术大学 [http://pypi.mirrors.ustc.edu.cn/simple/]
华中理工大学:[http://pypi.hustunique.com/]
山东理工大学:[http://pypi.sdutlinux.org/]