试图pip安装一个回购的特定分支。谷歌告诉我

pip install https://github.com/user/repo.git@branch

分支的名称是issue/34/oscar-0.6,所以我安装了https://github.com/tangentlabs/django-oscar-paypal.git@/issue/34/oscar-0.6,但它返回404。

如何安装这个分支?


当前回答

对于windows和pycharm设置:

如果你正在使用pycharm和如果你想使用pip3安装git+https://github.com/…

首先,你应该从https://git-scm.com/downloads下载git 然后重新启动pycharm 你可以使用pycharm终端来安装你想要的

其他回答

这招很管用:

pip3 install git+https://github.com/deepak1725/fabric8-analytics-worker.git@develop

地点:

发展:分支

fabric8-analytics-worker。git:回购

deepak1725:用户

url前缀git+(参见VCS支持):

pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6

并指定不带前导/的分支名称。

使用ssh凭证从私人回购安装的说明:

$ pip install git+ssh://git@github.com/myuser/foo.git@my_version

要从子目录安装包,请输入stackoverflow

$ pip install git+ssh://git@github.com/myuser/foo.git@my_version#subdirectory=stackoverflow

https://pip.pypa.io/en/stable/topics/vcs-support/

对于windows和pycharm设置:

如果你正在使用pycharm和如果你想使用pip3安装git+https://github.com/…

首先,你应该从https://git-scm.com/downloads下载git 然后重新启动pycharm 你可以使用pycharm终端来安装你想要的

您使用了egg文件安装过程。 此过程支持通过git、git+http、git+https、git+ssh、git+git和git+file进行安装。其中一些在其他答案中提到过。

很好。您可以使用分支、标记或散列进行安装。

Steve_K注意到使用“git+”安装可能会很慢,并建议通过zip文件安装:

pip install https://github.com/user/repository/archive/branch.zip

或者,如果存在的话,我建议您使用.whl文件进行安装。

pip install https://github.com/user/repository/archive/branch.whl

这是很新的格式,比鸡蛋文件更新。它需要wheel和setuptools>=0.8个包。您可以在文档中找到更多信息。