主要原因是pip默认下载使用的源是国外的,因此下载速度会很慢,所以在下载的时候我们可以将源地址换为国内的源,会大大提升下载速度。
常用的国内源有以下:
-
阿里云: https://mirrors.aliyun.com/pypi/simple/
-
豆瓣:http://pypi.douban.com/simple/
-
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
-
中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/
-
华中科技大学:http://pypi.hustunique.com/
- 华中理工大学:
https://pypi.hustunique.com/
- 山东理工大学:
https://pypi.sdutlinux.org/
pip 使用国内源下载软件包用法为:pip -i 镜像地址 要下载的第三方库例如:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ yagmail 这样就会从清华大学镜像安装django文件