How to fix pip under Debian 6.0 (squeeze): ImportError: cannot import name parser

The pip utility distributed with Debian 6.0 has a bug once you upgrade it with pip install -U pip. You will easily get this error when you try to install a new package with it:

root@worker2:~# pip install setproctitle
Traceback (most recent call last):
File "/usr/bin/pip", line 8, in <module>
from pip.baseparser import parser
ImportError: cannot import name parser

Luckly there is a very easy workaround:

easy_install pip
rm /usr/bin/pip
ln -sv /usr/local/bin/pip-2.6 /usr/bin/pip
pip install pip --upgrade

Reference: http://blog.102web.ru/tag/virtualenvs/