使用更新包(在我的例子中是 IPython)后pip install -U ipython
运行任何使用入口点的 Python 脚本都会失败并出现以下错误:
Traceback (most recent call last):
File "/home/adrian/dev/indico/env/bin/indico", line 5, in <module>
from pkg_resources import load_entry_point
...
File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8], requirement_string))
pkg_resources._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'< 2.0'"
其他没有改变,我没有更新任何其他库。
这是由以下问题引起的setuptools==20.2.1
它是由 IPython 拉入的(setuptools>..
), so a pip install -U
更新了。
在发布修复版本或从 PyPI 中提取损坏版本之前,有一个简单的解决方法(但请注意,如果更新了 setuptools,它将再次损坏):
pip install -U pip
pip uninstall setuptools
pip install 'setuptools<20.2'
The pip
由于旧版本,需要更新pip
没有的话就无法工作setuptools
正在安装
有关详细信息,请参阅这些 IRC 日志和 BitBucket 问题:
- http://chat-logs.dcpython.org/day/pypa/2016-02-25 http://chat-logs.dcpython.org/day/pypa/2016-02-25
- https://bitbucket.org/pypa/setuptools/issues/502/packaging-164-does-not-allow-whitepace https://bitbucket.org/pypa/setuptools/issues/502/packaging-164-does-not-allow-whitepace
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)