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/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM