Int*_*rer 11 python git pip github requirements.txt
我正在尝试将一个包添加到我的requirements.txt文件中,即:
ssh配置了私人仓库master,其名称中带有斜杠ssh协议互联网上到处都是关于这个话题的问题。以下是关于此的pip文档:
pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
以及来自如何在requirements.txt中声明直接github源的GitHub答案
git+git://github.com/path/to/package-two@master#egg=package-two
尝试方法#1
我试图在我的requirements.txt文件中使用这个答案:
-e git+ssh://github.com/Organization/repo-name.git@branch/name#egg=foo
Run Code Online (Sandbox Code Playgroud)
我收到错误:
ERROR: Command errored out with exit status 128: git clone -q ssh://github.com/Organization/repo-name.git /path/to/venv/src/foo Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)
当我使用以下选项查看日志时--log:
-e git+ssh://github.com/Organization/repo-name.git@branch/name#egg=foo
Run Code Online (Sandbox Code Playgroud)
尝试方法#2
我尝试的另一种方法requirements.txt:
-e git+git@github.com:Organization/repo-name.git#egg=foo
Run Code Online (Sandbox Code Playgroud)
这里面的克隆确实有效!它还打印此警告:DEPRECATION: This form of VCS requirement is being deprecated
不幸的是,我无法弄清楚如何以这种格式指定分支名称。
我究竟做错了什么?我错过了什么吗?
仅供参考,我的版本:
ERROR: Command errored out with exit status 128: git clone -q ssh://github.com/Organization/repo-name.git /path/to/venv/src/foo Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)
Int*_*rer 12
我在这两种情况下都解决了我的问题......语法
尝试#1
错误:需要说git@github.com
正确方法:
-e git+ssh://git@github.com/Organization/repo-name.git@branch/name#egg=foo
Run Code Online (Sandbox Code Playgroud)
尝试#2
错误:不知道可以使用@两次
正确方法:
-e git+git@github.com:Organization/repo-name.git@branch/name#egg=foo
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19026 次 |
| 最近记录: |