一般使用pip install package_name
直接从官方PyPi获取,但有些库官方也只是保持在某些版本。如果有一些Bug修复或者有人根据自己需求新增了一些功能并且Pull requests
到了Github上,但是还没有被作者或官方收录,那么该如何从Github上去安装?
通过搜索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
原文:https://www.cnblogs.com/dream08/p/14958419.html