Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install latest release from GitHub

Tags:

python

github

pip

I know I can install the master branch with:

pip install git+https://github.com/USER/REPO

I also know I can install a specific release with:

pip install git+https://github.com/USER/REPO@RELEASE

But is there a way to install the latest release (the one GitHub returns at https://github.com/USER/REPO/releases/latest)? I've tried the following:

pip install git+https://github.com/USER/REPO@latest

but it fails:

ERROR: Command errored out with exit status 1: git checkout -q latest

EDIT: This question is not a duplicate of Pip doesn't install latest GitHub release. The latter is about how to install a specific release and/or from the master branch, but not from the latest release.

like image 444
Roméo Després Avatar asked May 30 '26 18:05

Roméo Després


1 Answers

You can use the github API. Something like

pip install "git+https://github.com/USER/REPO@$(curl -s https://api.github.com/repos/USER/REPO/releases/latest | jq -r ".tag_name")"

would probably work for you. If you don't feel like installing jq, there's e.g. this gist.

like image 107
Saska Karsi Avatar answered Jun 01 '26 18:06

Saska Karsi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!