使用pip安裝python的包,使用http://pypi.python.org的官方源會出現訪問不了的情況,查資料發現可以使用
國內的一些源來下載包。例如安裝某個包Xstatic-juery,使用如下命令:
pip install Xstatic-juery -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
-i 表示使用其他的源,不使用默認的官方的源,--trusted-host 表示可信,可以寫到配置Pip的配置
文件中。
以下是其他的國內源:
http://pypi.douban.com/ 豆瓣
http://pypi.hustunique.com/ 華中理工大學
http://pypi.sdutlinux.org/ 山東理工大學
http://pypi.mirrors.ustc.edu.cn/ 中國科學技術大學