python github - pip install from git repo branch

requirements txt (5)

Trying to pip install a repo's specific branch. Google tells me to

pip install[email protected]

The branch's name is issue/34/oscar-0.6 so I did pip install[email protected]/issue/34/oscar-0.6 but its returning a 404.

How do I install this branch?


Instructions to install from private repo using ssh credentials.

For usage:

$ pip install git+ssh://[email protected]/myuser/[email protected]_version

For development:

$ git clone [email protected]/myuser/[email protected]_version
$ pip install --editable ./

Just to add an extra, if you want to install it in your pip file it can be added like this:

-e git+[email protected]/34/oscar-0.6#egg=django-oscar-paypal

It will be saved as an egg though.

Using pip with git+ to clone a repository can be extremely slow (test with[email protected]/1.6.x for example, it will take a few minutes). The fastest thing I've found, which works with GitHub and BitBucket, is:

pip install

which becomes for django master:

pip install

for django stable/1.7.x:

pip install

With BitBucket it's about the same predictable pattern:

pip install

Here, the master branch is generally named default. This will make your requirements.txt installing much faster.

Some other answers mention variations required when placing the package to be installed into your 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:

Prepend the url prefix git+ (See VCS Support):

pip install git+[email protected]/34/oscar-0.6

And specify the branch name without the leading /.

Make sure you run :

git config push.default tracking

to be able to push trouble free

python git pip