pip install 提示"no previously-included directories found matching"及"no previously-included files matching found anywhere in distribution",且偶发无法关联安装 PyPI 库的故障

时间:2023-03-09 03:44:50
pip install 提示"no previously-included directories found matching"及"no previously-included files matching found anywhere in distribution",且偶发无法关联安装 PyPI 库的故障

环境描述:

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 命令进行检查。

html,body { font-size: 12pt }
body { font-family: Helvetica, "Hiragino Sans GB", "微软雅黑", "Microsoft YaHei UI", SimSun, SimHei, arial, sans-serif; line-height: 1.6; margin: 0 auto; padding: 1.25rem 1rem }
h1,h2,h3,h4,h5,h6 { margin: 1.25rem 0 0.625rem; padding: 0; font-weight: bold }
h1 { font-size: 1.67rem }
h2 { font-size: 1.5rem }
h3 { font-size: 1.25rem }
h4 { font-size: 1.17rem }
h5 { font-size: 1rem }
h6 { font-size: 1rem; color: #777777; margin: 1rem 0 }
div,p,ul,ol,dl,li { margin: 0 }
blockquote,table,pre,code { margin: 8px 0 }
ul,ol { padding-left: 2rem }
ol.wiz-list-level1>li { list-style-type: decimal }
ol.wiz-list-level2>li { list-style-type: lower-latin }
ol.wiz-list-level3>li { list-style-type: lower-roman }
blockquote { padding: 0 0.75rem }
blockquote>:first-child { margin-top: 0 }
blockquote>:last-child { margin-bottom: 0 }
img { border: 0; max-width: 100%; height: auto !important; margin: 2px 0 }
table { border-collapse: collapse; border: 1px solid #bbbbbb }
td,th { padding: 4px 8px; border-collapse: collapse; border: 1px solid #bbbbbb; min-height: 28px }
.wiz-hide { display: none !important }