環境描述:html
Python 2.7.5
CentOS-7.2
報錯現象:
(1).在虛擬環境下運行
pip install 命令安裝 PyPI 第三方庫,出現相似以下告警。
Running setup.py egg_info for package Werkzeug
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes'
warning: no previously-included files matching '*.py[cdo]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
(2).偶發沒法關聯安裝 PyPI 庫的故障。
例如:安裝 python-daemon (2.1.2) 須要先安裝 docutils (0.14) 及 lockfile (0.12.2)。而故障發生時,沒法自動安裝關聯 PyPI 庫。
(3).檢查虛擬環境 pip 版本,發現版本較低。
例如:虛擬環境下 pip 版本爲 1.4.1,非虛擬環境下 pip 版本爲 9.0.1。
報錯緣由:
pip 版本太低,致使安裝報錯。
報錯處理方法:
升級 pip 工具,語句相似以下。
#> pip install pip==9.0.1
隨後,可經過 pip list 命令進行檢查。