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:

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

Luckly there is a very easy workaround:

1
2
3
4
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/

comments powered by Disqus
source code available on GitHub
Built with Hugo
Theme Stack designed by Jimmy