How to state in requirements.txt a direct github source

I've installed a library using the command

    pip install git+git://github.com/mozilla/elasticutils.git

which installs it directly from a Github repository. This works fine and I want to have that dependency in my requirements.txt. I've looked at other tickets like this but that didn't solve my problem. If I put something like

    -f git+git://github.com/mozilla/elasticutils.git
    elasticutils==0.7.dev

in the requirements.txt file, a pip install -r requirements.txt results in the following output:

    Downloading/unpacking elasticutils==0.7.dev (from -r requirements.txt (line 20))
      Could not find a version that satisfies the requirement elasticutils==0.7.dev (from -r requirements.txt (line 20)) (from versions: )
    No distributions matching the version for elasticutils==0.7.dev (from -r requirements.txt (line 20))

The documentation of the requirements file does not mention links using the git+git protocol specifier, so maybe this is just not supported.

Does anybody have a solution for my problem?

“Editable” packages syntax can be used in requirements.txt to import packages from a variety of VCS (git, hg, bzr, svn):

    -e git://github.com/mozilla/elasticutils.git#egg=elasticutils

Also, it is possible to point to particular commit:

    -e git://github.com/mozilla/elasticutils.git@000b14389171a9f0d7d713466b32bc649b0bed8e#egg=elasticutils

From: stackoverflow.com/q/16584552

Back to homepage or read more recommendations: