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/

If you enjoyed this article and want to show your appreciation, consider buying me a coffee using the button below. Your support, even a small gesture, means a lot and will inspire me to continue writing and sharing more articles on my blog ❤️

Buy Me a Coffee at ko-fi.com
source code available on GitHub
Built with Hugo
Theme Stack designed by Jimmy