pip通过指定分支和子目录从git仓库中拉取python包

需求

  • 使用pip 从 git仓库而不是pypi源安装python包
  • 不是从master分支拉取而是其他分支(例子 test分支)
  • setup.py 不在根目录下面

例子

github地址: https://github.com/Me1onRind/pip_demo test分支

+ pip_demo
| + foo
	| + bar
	  | - demo.py
	| - setup.py
pip install git+ssh://git@github.com/Me1onRind/pip_demo.git@test#"egg=bar&subdirectory=foo"

ssh协议的情况下 域名和仓库路径之间的分割符合是 : 需要替换为 / 否则会报 ssh: Could not resolve hostname 的错误

posted @ 2020-05-30 14:15  Me1onRind  阅读(1483)  评论(0编辑  收藏  举报