Requirements.txt 文件因 Git 回购源而失败
Requirements.txt file failing with a Git repo source
我有这个需求文件:
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 错误。一个可能的解决方案是从 pip install -r requirements.txt -t some/folder
中删除 -t
.
这个问题以前也出现过,网上搜索一下就可以here。
编辑:答案是从 requirements.txt 中删除 -e
。
我有这个需求文件:
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 错误。一个可能的解决方案是从 pip install -r requirements.txt -t some/folder
中删除 -t
.
这个问题以前也出现过,网上搜索一下就可以here。
编辑:答案是从 requirements.txt 中删除 -e
。