Nips Nips - 1 month ago 25
Python Question

How to freeze requirements of packages on pip install?

I have virtualenv with old django 1.3. I must use this version but when I install:

pip install django-debug-toolbar


no matter what version pip trying upgrade django to 1.4 ...

How to force install packages with freezed django (various - django-debug-toolbar is one of many)?

Answer

The django-debug-toolbar package is closely tied to specific versions of Django; the latest package requires Django 1.4.2 or newer and that is stated in the requirements:

install_requires=[
    'django>=1.4.2,<1.7',
    'sqlparse',
],

and on the PyPI page:

The current version of the Debug Toolbar is 0.11.0. It works on Django 1.4, 1.5 and 1.6.

You need to install an older version of the package; 0.10.0 upgraded the minimum version requirement from Django 1.3 to 1.4, so 0.9.4 is the most recent version that still works with your older Django setup:

pip install django-debug-toolbar==0.9.4