Requirements.txt文件因Git存储库来源而失败

问题描述

我有以下要求文件

requests==2.24.0
-e git+ssh://git@omyurl/path/to/mygit.git#egg=mymodule

pip install -r requirements.txt -t some/folder出现时,广告:

ERROR: Command errored out with exit status 1:
     command: /../.pyenv/versions/3.7.5/bin/python3.7 -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/../src/mymodule/setup.py'"'"'; __file__='"'"'/../src/mymodule/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' develop --no-deps --home=/private/var/folders/14/xyz/T/pip-target-9ag4c8zg
         cwd: /../src/mymodule/
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
    
    error: option --home not recognized

当我走很长的路,降低回购和pip install -e . -t some/folder时,会遇到相同的错误。但是当我pip install . -t some/folder时,没有错误。知道如何使用Requirements.txt进行此操作吗?

解决方法

这不应只是python bug。该问题的可能解决方案是从您的-t中删除pip install -r requirements.txt -t some/folder

该问题以前曾发生过,在互联网上进行少许搜索就会带您here

编辑:答案是从Requirements.txt中删除-e