用国内镜像比国外(pip默认的)快得多;当然也适用于其他的python包。
1.安装语句
下述语句注意空格,也可以在包名称后面 加上 “==版本号”:
pip/pip3
install -i 镜像地址 包名称
镜像地址和包名称交换位置也可以,亦即
pip/pip3
install 包名称 -i 镜像地址
例如从清华镜像下载安装tensorflow
pip
install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
2.一些常用的镜像地址
有些包在有些镜像上好像没有,可以多尝试几个。
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/