用默認的pip安裝源pypi.python.org由於在國外經常會出現超時的問題,而且安裝速度極其的慢,如下圖中的超時問題=>
一、可通過以下方式解決。
cat ~/.pip/pip.conf [global] timeout = 60 #設置超時時間 index-url = http://pypi.douban.com/simple #設置國內的鏡像源,還有其他國內的源可以從網上進行搜索
二、
pip install salt-api==0.8.4.1 Collecting salt-api==0.8.4.1 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安裝的時候加上后面的參數,如下:
pip install salt-api==0.8.4.1 --trusted-host pypi.douban.com
或通過requirements文件進行軟件的批量安裝
pip install -r requirements.txt --trusted-host pypi.douban.com
Requirement already satisfied (use --upgrade to upgrade): simplegeneric==0.8.1 in /root/python_dev/.pyenv/versions/2.7.1/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Collecting singledispatch==3.4.0.3 (from -r requirements.txt (line 2))
Downloading http://pypi.douban.com/packages/3.4/s/singledispatch/singledispatch-3.4.0.3-py2.py3-none-any.whl
。。。。。。。。。。
發現通過上面的方式速度快了很多,也沒有上面出現的超時問題了