一般情况下安装python包默认是从pypi.org官网下载包,然而官网是国外的,下载速度比较慢。为了加快下载速度可以更换下载地址,下载地址更换成国内源,国内源有以下几个:
阿里云开源镜像站 ----> http://mirrors.aliyun.com/
网易开源镜像站 ----> http://mirrors.163.com/
搜狐开源镜像 ----> http://mirrors.sohu.com/
浙江大学开源镜像站 ----> http://mirrors.zju.edu.cn/
清华大学开源软件镜像站 ----> https://pypi.tuna.tsinghua.edu.cn/simple
中国科学技术大学 ----> http://mirrors.ustc.edu.cn/
腾讯开源镜像站 ----> http://mirrors.cloud.tencent.com/pypi/simple
豆瓣开源镜像站 ----> http://pypi.douban.com/simple/
如果终端安装可以在每次下载包的命令加上指定下载地址,例如:
pip install xxxxx -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
(xxxxx为你要下载的包)