我在 CentOS 7 上通过 pip 设置 pyparser 时看到以下错误
/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-PMzCYU/pycparser/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0bpBrX-record/install-record.txt --single-version-externally-managed --compile
Traceback (most recent call last):
文件“”,第 1 行,在 init.py 中”,第 12 行,在
导入setuptools.version
文件“/usr/lib/python2.7/site-packages/setuptools/version.py”,第 1 行,位于
导入pkg_resources
文件“/usr/lib/python2.7/site-packages/pkg_resources/init.py”,第 72 行,在
进口包装要求
文件“/usr/lib/python2.7/site-packages/packaging/requirements.py”,第 59 行,位于
MARKER_EXPR = originalTextFor(MARKER_EXPR())("标记")
类型错误:call() 恰好需要 2 个参数(给定 1 个)
这似乎是由https://github.com/pypa/setuptools/commit/ff371f18f0076bc63da05334f7e551c1cc29e10d https://github.com/pypa/setuptools/commit/ff371f18f0076bc63da05334f7e551c1cc29e10d它在 setuptools v34.0.0 中发布。此提交删除了多个软件包的供应商。看起来这只会影响新的安装工具安装。现有的在 34.0.2 上没问题
通过对版本进行硬编码来解决:
pip install setuptools==33.1.1
仍在研究如何在安装 >= 34.0.0 后修复 pip 使用情况,
编辑:这是设计使然
“一般情况下,Setuptools 不再支持自我升级或安装。”http://setuptools.readthedocs.io/en/latest/history.html#v34-0-0 http://setuptools.readthedocs.io/en/latest/history.html#v34-0-0
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)