前傳
自從寬帶換至小開發商的ISP上,問題不斷,原來用的很好的 pip 也不能正常工作了,於是,開始找代理。
方案
利用代理 - 此方法需要 代理服務器配合,沒試驗成功
$ export http_proxy="127.0.0.1:8118" $ export https_proxy="127.0.0.1:8118" $ sudo -E pip install testrepository
修改源 - 使用清華的源,這是推薦用法
$ sudo vim ~/.pip/pip.conf
[global]
index-url=http://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
參考:
http://my.oschina.net/dancing/blog/158509
http://mirrors.tuna.tsinghua.edu.cn/pypi/