pip默认源是国外的网址,下载速度非常慢,将pip的源替换为国内的站点可以解决该问题。
一些常用的国内源
清华大学: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
(笔者现在使用的是豆瓣源)
永久修改为国内源
修改配置文件~/.pip/pip.conf(一般需要新建,"."表示隐藏目录或隐藏文件)
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = http://pypi.douban.com
临时使用某个源下载
pip install web.py -i http://pypi.douban.com/simple