PIP hg + and git + always download the package instead of finding a satisfied requirement

My other question here just got an answer about why pip svn+ always overloaded whole packages.

Now I have several packages in my pip_requirements file that always load and not find that the package requirements are being met.

These are the following types:

  • git+git://github.com/yuchant/django-jinja2.git
  • hg+https://bitbucket.org/yuchant/django-storages

With svn+ my packages appear to be satisfied, regardless of whether I specify a trunk or a specific revision. Is the template great for git and mercury?

+1
git python mercurial pip
source share
1 answer

Short answer

When using any VCS with item requirements files, you must always specify using #egg=[egg-name]

So, your requirements file should contain:

 git+git://github.com/yuchant/django-jinja2.git#egg=django-jinja2 hg+https://bitbucket.org/yuchant/django-storages#egg=django-storages 

Long answer

If you specify the protocol requirements in the same way as in your question, without #egg=[egg-name] . I am going to call this line the egg identifier. The problem is very similar to your last question. Pip uses the egg identifier to find the currently installed python modules.

This is what happens if the egg id is not specified:

  • Pip is looking for git+git://github.com/yuchant/django-jinja2.git in installed modules
  • Pip does not find it, so it tries to install it again.

If you use the egg id, this will not have this problem.

+3
source share

All Articles