卍 花径不曾缘客扫, 蓬门今始为君开. 古佛拈花方一笑, 痴人说梦已三生!

Python-pip使用国内镜像加速下载

Python 拈花古佛 13478℃ 0评论 繁體

pipy国内镜像目前有:

http://pypi.douban.com/  豆瓣

http://pypi.hustunique.com/  华中理工大学

http://pypi.sdutlinux.org/  山东理工大学

http://pypi.mirrors.ustc.edu.cn/  中国科学技术大学

http://mirrors.aliyun.com/pypi/simple/  阿里云

对于pip这种在线安装的方式来说,很方便,但网络不稳定的话很要命。使用国内镜像相对好一些,
如果想手动指定源,可以在pip后面跟-i 来指定源,比如用豆瓣的源来安装web.py框架:

pip install web.py -i http://pypi.douban.com/simple

注意后面要有/simple目录!!!

如果提示:

The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with ‘–trusted-host pypi.douban.com’.

请试试这个的办法

pip install virtualenv  --trusted-host pypi.douban.com -i http://pypi.douban.com/simple

要配制成默认的话,需要创建或修改配置文件
编辑~/.pip/pip.conf:

nano ~/.pip/pip.conf

添加

[global]
index-url = http://pypi.douban.com/simple

 

转载请注明:拈花古佛 » Python-pip使用国内镜像加速下载

喜欢 (1)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址