首页 > 编程语言 > 详细

从Github安装Python库

时间:2021-07-01 14:36:47      阅读:33      评论:0      收藏:0      [点我收藏+]

第三方库的使用

1. 问题

一般使用pip install package_name直接从官方PyPi获取,但有些库官方也只是保持在某些版本。如果有一些Bug修复或者有人根据自己需求新增了一些功能并且Pull requests到了Github上,但是还没有被作者或官方收录,那么该如何从Github上去安装?

2. 解决

通过搜索pip documentation,在其Support下的Git中有以下示例:

[-e] git+http://git.example.com/MyProject#egg=MyProject
[-e] git+https://git.example.com/MyProject#egg=MyProject
[-e] git+ssh://git.example.com/MyProject#egg=MyProject
[-e] git+file:///home/user/projects/MyProject#egg=MyProject

如使用pip install git+http://git.example.com/MyProject#egg=MyProjec 即可从已有的Github仓库链接安装,注意末尾别少了#egg项目名称。

同时,还可以指定分支或者标签

[-e] git+https://git.example.com/MyProject.git@main#egg=MyProject

从Github安装Python库

原文:https://www.cnblogs.com/dream08/p/14958419.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!