Pip and git on the edge

By on 20 June 2013, in Blog, Development

Pip install fails when you use a tag from a Git repository

If you are (or not) on OSX with git 1.8.3.x and the standard pip binary, you could eventually encounter this bug:

[localhost] out: Obtaining sparks from git+https://github.com/Karmak23/sparks.git@sparks-2.7.7#egg=sparks (from -r /Users/olive/sources/1flow/config/requirements.txt (line 1))
[localhost] out:   Updating /Users/olive/.virtualenvs/1flow/src/sparks clone (to sparks-2.7.7)
[localhost] out:   Complete output from command /usr/local/bin/git rev-parse (detachedfrom27d4555):
[localhost] out:   fatal: ambiguous argument '(detachedfrom27d4555)': unknown revision or path not in the working tree.
[localhost] out:
[localhost] out: Use '--' to separate paths from revisions, like this:
[localhost] out:
[localhost] out: 'git <command> [<revision>...] -- [<file>...]'
[localhost] out:
[localhost] out: (detachedfrom27d4555)
[localhost] out:
[localhost] out: ----------------------------------------
[localhost] out: Command /usr/local/bin/git rev-parse (detachedfrom27d4555) failed with error code 128 in /Users/olive/.virtualenvs/1flow/src/sparks
[localhost] out: Storing complete log in /Users/olive/.pip/pip.log
[localhost] out:

Fatal error: run() received nonzero return code 1 while executing!

You should just install the development version of pip:

pip install -U -e git+https://github.com/pypa/pip.git@develop#egg=pip-dev

The fix is not even included in pip 1.3.1.

Reference issue

It took me nearly 2 days to find a mention of the solution