pip install –r ./requirements.txt 报错 改成 pip install -r requirements.txt 成功

Posted stillstep

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip install –r ./requirements.txt 报错 改成 pip install -r requirements.txt 成功相关的知识,希望对你有一定的参考价值。

Invalid requirement: ‘–r‘
Traceback (most recent call last):
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 92, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1617, in parseString
raise exc
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1607, in parseString
loc, tokens = self._parse( instring, 0 )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3376, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3698, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3359, in parseImpl
loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 2670, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected W:(abcd...) (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/home/dev/.pyenv/versions/3.6.1/envs/env361/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "‘–r‘"

以上是关于pip install –r ./requirements.txt 报错 改成 pip install -r requirements.txt 成功的主要内容,如果未能解决你的问题,请参考以下文章

“-r”在 pip install -r requirements.txt 中有啥作用

linux 执行:pip3 install -r requirements.txt 报错

Pip Install -r continue 过去失败的安装

Pip Install -r continue 过去失败的安装

pip install -r 要求到 Colab 中的特定目录

Conda 版本 pip install -r requirements.txt --target ./lib