如何解决当requirements.txt具有来自git的可编辑依赖项时,pip安装不起作用
我有以下Pipfile
,来自git有一个依赖项:
[packages]
requests = {editable = true,git = "https://github.com/requests/requests.git",ref = "v2.20.1"}
然后我跑步:
pipenv install
pipenv run pip freeze >requirements.txt
哪个生成此requirements.txt
:
certifi==2020.6.20
chardet==3.0.4
idna==2.7
-e git+https://github.com/requests/requests.git@6cfbe1aedd56f8c2f9ff8b968efe65b22669795b#egg=requests
urllib3==1.24.3
现在可以正常使用:pipenv run pip install -r requirements.txt
但这不是:pipenv run pip install -r requirements.txt --target dist
错误:
Installing collected packages: certifi,chardet,idna,urllib3,requests
Attempting uninstall: requests
Found existing installation: requests 2.20.1
Uninstalling requests-2.20.1:
Successfully uninstalled requests-2.20.1
Running setup.py develop for requests
ERROR: Command errored out with exit status 1:
command: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/bin/python -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/setup.py'"'"'; __file__='"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/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/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-target-nxsmebki
cwd: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/
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
----------------------------------------
Rolling back uninstall of requests
Moving to /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/lib/python3.8/site-packages/requests.egg-link
from /private/var/folders/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-uninstall-iilp2si9/requests.egg-link
ERROR: Command errored out with exit status 1: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/bin/python -c 'import sys,'"'"'exec'"'"'))' develop --no-deps --home /private/var/folders/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-target-nxsmebki Check the logs for full command output.
如果我删除了editable = true
,它将起作用,但是我需要对其进行编辑,以便按照here的描述将传递依赖项添加到Pipfile.lock
中。
所以我的问题是:当--target
具有来自git的可编辑依赖性时,为什么requirements.txt
标志不起作用?
我正在使用python 3.8.2和pip 20.2.2。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。