24

I have across a very weird issue. I try to pip install a package from my github fork. I have done this multiple times in the past and it works always.

This is what I do:

pip install git+https...@my_branch

While this works perfectly in my local machine, when I try to w Windows Remote machine and to my Ubuntu Vagrant box it doesnt work.

Instead of installing the package with my_branch, it installs the master branch. Initially I thought it was related with an outdated version of pip but after upgrading to the latest version, I keep facing the same issue.

Any ideas whats the problem?

user1919
  • 3,818
  • 17
  • 62
  • 97
  • my issue is very similar with this one: https://groups.google.com/forum/#!topic/python-virtualenv/uxBBJVt_XOc – user1919 Jan 05 '17 at 18:09

3 Answers3

16

Maybe some characters like the @ character are not recognized properly in your command in other environments? Try putting quotes, like this: pip install "git+https...@my_branch"

Swergas
  • 362
  • 4
  • 9
8

Suppose you have forked some git repo and made some changes. To install this specific branch:

  1. Release a new version from your branch and add a version tag, like v1.0
  2. Run pip install -e git+https://github.com/your_user_name/repo_name@v1.0#egg=repo_name in the terminal
Sasa
  • 103
  • 1
  • 5
5

Here is how I do it is a private repo and I use the branch name:

pip install "git+ssh://git@github.com/your_repo.git@your_branch_name"

Note for authentication, your password might be a token from github if you have set that up.

Checkout this answer for more ways to pip install: https://stackoverflow.com/a/13754517/5042916

robert wallace
  • 379
  • 4
  • 7