本文翻译自:pip install from git repo branch

Trying to pip install a repo's specific branch. 试图pip安装回购协议的特定分支。 Google tells me to Google告诉我

pip install git+ https://github.com/user/repo.git@branch 点安装git + https://github.com/user/repo.git@branch

The branch's name is issue/34/oscar-0.6 so I did pip install https://github.com/tangentlabs/django-oscar-paypal.git@/issue/34/oscar-0.6 but its returning a 404. 分支的名称是issue/34/oscar-0.6所以我确实pip install https://github.com/tangentlabs/django-oscar-paypal.git@/issue/34/oscar-0.6但返回了404。

How do I install this branch? 如何安装此分支?


#1楼

参考:https://stackoom.com/question/1MLP8/从git-repo分支安装pip


#2楼

Prepend the url prefix git+ (See VCS Support ): 在网址前缀git+ (请参阅VCS支持 ):

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

And specify the branch name without the leading / . 并指定不带/的分支名称。


#3楼

Using pip with git+ to clone a repository can be extremely slow (test with https://github.com/django/django@stable/1.6.x for example, it will take a few minutes). 在git +上使用pip克隆存储库可能会非常慢(例如,使用https://github.com/django/django@stable/1.6.x进行测试,这将需要几分钟的时间)。 The fastest thing I've found, which works with GitHub and BitBucket, is: 我发现与GitHub和BitBucket兼容的最快的东西是:

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

which becomes for django master: 成为django master的对象:

pip install https://github.com/django/django/archive/master.zip

for django stable/1.7.x: 对于django stable / 1.7.x:

pip install https://github.com/django/django/archive/stable/1.7.x.zip

With BitBucket it's about the same predictable pattern: 使用BitBucket,它具有相同的可预测模式:

pip install https://bitbucket.org/izi/django-admin-tools/get/default.zip

Here, the master branch is generally named default. 在这里,master分支通常被命名为default。 This will make your requirements.txt installing much faster. 这将使您的requirements.txt安装速度更快。

Some other answers mention variations required when placing the package to be installed into your requirements.txt . 其他一些答案提到将要安装的软件包放入您的requirements.txt Note that with this archive syntax, the leading -e and trailing #egg=blah-blah are not required, and you can just simply paste the URL, so your requirements.txt looks like: 请注意,这个档案的语法,领先-e和尾随#egg=blah-blah 不是必需的,你可以只是简单粘贴URL,所以你requirements.txt的样子:

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

#4楼

Just to add an extra, if you want to install it in your pip file it can be added like this: 只是要添加一个额外的内容,如果要在pip文件中安装它,可以这样添加:

-e git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6#egg=django-oscar-paypal

It will be saved as an egg though. 但是它将被保存为鸡蛋。


#5楼

Instructions to install from private repo using ssh credentials . 使用ssh凭证从专用存储库安装的说明。

For usage: 使用方法:

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

For development: 开发:

$ git clone git@github.com/myuser/foo.git@my_version
$ pip install --editable ./

#6楼

You used the egg files install procedure. 您使用了egg文件的安装过程。 This procedure supports installing over git , git+http , git+https , git+ssh , git+git and git+file . 此过程支持通过gitgit+httpgit+httpsgit+sshgit+gitgit+file Some of these are mentioned. 其中提到了一些。

It's good you can use branches, tags, or hashes to install. 可以使用分支,标签或哈希值进行安装是很好的。

@Steve_K noted it can be slow to install with "git+" and proposed installing via zip file: @Steve_K指出,使用“ git +”安装可能会很慢,因此建议通过zip文件进行安装:

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

Alternatively, I suggest you may install using the .whl file if this exists. 或者,建议您使用.whl文件(如果存在)进行安装。

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

It's pretty new format, newer than egg files. 这是一种非常新的格式,比egg文件更新。 It requires wheel and setuptools>=0.8 packages. 它需要wheel和setuptools> = 0.8软件包。 You can find more in here . 您可以在这里找到更多。

从git repo分支安装pip相关推荐

  1. 代码管理平台介绍、安装svn、客户端使用svn、远程仓库、分支管理、标签管理、git别名、搭建git服务、安装gitlab、简单使用gitlab、备份和恢复

    22.1 代码管理平台介绍 现在的开发工作都是由团队合作来完成开发,通常都是团队中的每个人或者每几个人完成一个模块的开发,最后再将模块拼凑起来,形成一个完整的项目,这就涉及到了协同开发.在各个模块的开 ...

  2. 【代码管理】GitHub超详细图文攻略 - Git客户端下载安装 GitHub提交修改源码工作流程 Git分支 标签 过滤 Git版本工作流

    GitHub操作总结 : 总结看不明白就看下面的详细讲解. . 作者 :万境绝尘  转载请注明出处 : http://blog.csdn.net/shulianghan/article/details ...

  3. 一键更新目录下所有git repo的脚本

    一键更新目录下所有git repo的脚本 当一个大型软件包含几十个git库的时候,要是每次都手动更新会很麻烦,最近python写的比较多,顺手写了一个一件更新脚本. 使用了一个叫gitpython的库 ...

  4. 《Python笔记》安装(pip)第三方包报错

    目录 Python版本 报错信息 pip 安装numpy报错 pip 安装 scipy报错 pip 安装 pywin32 报错 解决办法 网络方法1 网络方法2 请测解决方法 Python版本 $ p ...

  5. git简介、安装、基本操作——Git折腾小记

    这两天刚完成了一个小项目,整理资料发现现在写代码跟文档又没有版本控制的意识,刚好前两天电脑出问题,差点所有代码跟文档全丢掉,所以这两天又在自己的台式机上架起了git,做所谓的代码服务器,之前折腾过一次 ...

  6. Git的使用——Git 常用命令总结、Git的使用、Git 的分支、远程仓库的使用、IDEA 中使用Git、Git 工作流(Git Flow、Github Flow、GitLab Flow)

    Git的使用--Git 常用命令总结.Git的使用.Git 的分支.远程仓库的使用.IDEA 中使用Git 一.Git 常用命令总结 为了方便后续查找命令,故先把总结放前面,教程放后面 1.git 基 ...

  7. centos7下安装pip以及mysql等软件

    1.安装pip 安装失败了的提示: No package pip available. Error: Nothing to do 解决方法: 需要先安装扩展源EPEL. EPEL(http://fed ...

  8. git查看分支记录_git原理

    标准用法请参考git-scm.本文记录笔者对git的一些理解,如有错误,欢迎指正. 引用内容已用markdown记号标出.版权所有,转载请注明出处. 文章完成中 这是引用内容 First Editio ...

  9. Git Flow分支策略与Azure DevOps相关功能简介

    想了很久,还是写这么一篇文章来总结一下有关分支策略和DevOps的一些内容吧.其实,DevOps相关的内容并不是我的工作范围,不过对于敏捷开发.DevOps.项目管理等等这一系列的与开发过程相关的内容 ...

最新文章

  1. haskell的分数运算
  2. C#中一些易混知识的比较
  3. spark sql 本地调试_干货 | 如何成为大数据Spark高手
  4. linux kill -9 杀不掉的进程
  5. Java中的JDBC教程
  6. et200sp模块接线手册_格力变频空调模块常见故障处理。
  7. VB6中的面向对象编程---实现类继承
  8. 我的android学习脚步----------- 的第一个应用
  9. 计算机硬件及软件组成,计算机的组成及功能(硬件及操作系统)
  10. 从终端直接下载cuDNN
  11. 关于Microsoft office深色模式设置
  12. Python项目部署的三大神器
  13. 石家庄地铁查询系统(双人项目)
  14. 电脑微软商店消失解决办法
  15. AI Studio 精品项目 | 基于Few-shot Learning实现中文科学文献学科分类
  16. 群晖NAS DSM7.0系统安装qBittorrent和transmission套件教程
  17. mysql导数据到mongo,mysql数据导入到mongodb
  18. 2017移动端UI设计规范模板参考以及设计规范的好处
  19. CRM客户管理系统哪个好用?盘点前十名!
  20. 免裁券也不灵?360被曝开始“裁员”,比例达15%到20%

热门文章

  1. Linux计划任务之_Crontab
  2. jPList – 实现灵活排序和分页功能的 jQuery 插件
  3. eclipse中svn检出项目,项目名上带有红色感叹号
  4. 简单了解关于.net framework的一些常见问题
  5. CSS中超链接样式的书写顺序
  6. ubuntu11中卸载gnome3
  7. rhel5.3服务器安装centOS的yum源
  8. 自动化测试元素查找利器firepath介绍
  9. Redis的持久化——AOF
  10. 【转】Linux之printf命令