简体   繁体   English

Pip未安装最新的GitHub版本

[英]Pip doesn't install latest GitHub release

I have two releases tagged on GitHub: 0.1 and 0.2. 我在GitHub上标记了两个版本:0.1和0.2。 When I manually download https://github.com/username/repo/tarball/master , version 0.2 gets downloaded. 当我手动下载https://github.com/username/repo/tarball/master ,将下载0.2版。 However, if I do pip install https://github.com/username/repo/tarball/master in my command line, version 0.1 get installed. 但是,如果我在命令行pip install https://github.com/username/repo/tarball/master ,则会pip install https://github.com/username/repo/tarball/master 0.1版。 Why is this happening? 为什么会这样呢? How can I install my repo's latest release via Pip? 如何通过Pip安装我的仓库的最新版本?

When this happens i usually do following: 发生这种情况时,我通常会执行以下操作:

  1. Create a text file with a requirement for pip specifying the git repo and the commit hashtag. 创建一个文本文件,要求pip指定git repo和commit标签。
  2. Use pip install with requirement option . 使用pip installpip install 选项

Eg: 例如:

requirement.txt: requirement.txt:

git+git://github.com/nathanborror/django-basic-apps.git@5d7705bc32b3eab042790dc26ffa1a1c81844438

from bash: 从bash:

pip install -r requirement.txt

Seems the issue was something much, much silly. 似乎这个问题有些愚蠢。 I forgot to update the package's version in setup.py to 0.2, so it was installing 0.1, even though the code was the one updated for 0.2. 我忘了将setup.py的软件包版本更新为0.2,因此它正在安装0.1,即使代码是针对0.2更新的。

The conclusion is: don't forget to check&update your package's version in setup.py ! 结论是:别忘了在setup.py检查并更新软件包的版本!

If this isn't the case, then try @JavaCake's solution. 如果不是这种情况,请尝试@JavaCake的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM