使用PyCharm我尝试为我的Docker容器添加项目解释器
但后来我得到了这个难以理解的错误。
Invalid requirement: 'redis\>=2.10.5'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'\\>=2.10.'
我能做些什么呢?
从pip
的官方文档:
https://pip.pypa.io/en/stable/reference/pip_install/#examples
$ pip install SomePackage # latest version
$ pip install SomePackage==1.0.4 # specific version
$ pip install 'SomePackage>=1.0.4' # minimum version
看来你必须使用撇号作为最低版本。
redis\>=2.10.5
的反斜杠是问题的罪魁祸首。用redis\>=2.10.5
替换'redis>=2.10.5'
。