I'm configuring Debian 5 to run my Django app. The required application is required incompatible with Python 2.5 packages. I installed Python 2.7 and created the symlink python -> /usr/bin/python2.7/bin/python. After I installed mod_wsgi ./configure --with-python=/usr/bin/python2.7/bin/python and added to httpd.conf WSGIPythonHome /usr/bin/python2.7/bin/python. Now I have a couple of problems. At first - after I manually installed setuptools and pip, at calling pip install -r requirements.txt of I have got an error:

raceback (most recent call last): File "/usr/bin/pip", line 5, in from pkg_resources import load_entry_point File "build/bdist.linux-i686/egg/pkg_resources.py", line 2607, in File "build/bdist.linux-i686/egg/pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: pip==1.0.2

How to fix the DistributionNotFound problem?

At second: in the system was installed mod_wsgi via apt-get, I manually compiled mod_wsgi 2.5 with configure flag without removing of existing version.

The app is not fire up now, how to check, as mod_wsgi works right?


You should not set WSGIPythonHome for a start. Even in situations where it is set, you don't set it to the executable path. As per documentation you set it to what sys.prefix is for Python installation you want to use.


As for checking whether mod_wsgi working, read:


and setup a WSGI hello world program first, not a complex Django system.



and watch:



i know it does not answer your question but lenny has reached end of life.

if this server is internet facing you should upgrade very very quickly to squeeze.

  • OK, I see. This is vps server, can I upgrade it to Squeeze? – I159 Feb 23 '12 at 7:56
  • @I159 If it's vanilla Debian, then yes, it can almost certainly be upgraded. You'll want to read up on performing a dist-upgrade. Whether or not your VPS provider will support this is another question, you will need to contact them. – jscott Feb 23 '12 at 12:01

Why not use virtualenv to install the required Python version for your Django app without having to touch the system wide Python install?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.