我通过pip在CentOS 7上设置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):File "", line 1, in init.py", line 12, in import setuptools.version File "/usr/lib/python2.7/site-packages/setuptools/version.py", line 1, in import pkg_resources File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 72, in import packaging.requirements File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker") TypeError: call() takes exactly 2 arguments (1 given)
这似乎是由https://github.com/pypa/setuptools/commit/ff371f18f0076bc63da05334f7e551c1cc29e10d引起的,它是在setuptools的v34.0.0中发布的.这个提交删除了几个包的销售.看起来这只会影响新的setuptools安装.现有的在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