pip安装包失败了

问题描述 投票:0回答:2

使用PyCharm我尝试为我的Docker容器添加项目解释器

enter image description here

但后来我得到了这个难以理解的错误。

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.'

enter image description here

我能做些什么呢?

python docker pip pycharm
2个回答
0
投票

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

看来你必须使用撇号作为最低版本。


0
投票

redis\>=2.10.5的反斜杠是问题的罪魁祸首。用redis\>=2.10.5替换'redis>=2.10.5'

© www.soinside.com 2019 - 2024. All rights reserved.