Python 豆瓣源

国内的pythoner强烈建议使用豆瓣的pypi源

https://pypi.douban.com/simple/ 

sudo pip install -i https://pypi.douban.com/simple/ scrapy

sudo pip install scrapy -i http://pypi.douban.com/simple ;--trusted-host pypi.douban.com

注意后面要有/simple目录。

虽然用easy_install和pip来安装第三方库很方便
它们的原理其实就是从Python的官方源pypi.python.org/pypi 下载到本地,然后解包安装。
不过因为某些原因,访问官方的pypi不稳定,很慢甚至有些还时不时的访问不了。

跟ubuntu的apt和centos的yum有各个镜像源一样,pypi也有。

在国内的强烈推荐豆瓣的源
http://pypi.douban.com/simple/
 

使用镜像源很简单,用-i指定就行了:
sudo easy_install -i http://pypi.douban.com/simple/ saltTesting
sudo pip install -i http://pypi.douban.com/simple/ saltTesting

Windows:

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'.

参考链接:https://www.douban.com/note/302711300/

原文地址:https://www.cnblogs.com/tanrong/p/8244924.html