While running python setup.py install is simple and easy, it doesn’t always work when you want to install some things (such as pip in my case). Especially when you have multiple versions of Python and you’re not using virtualenv.
To install pip on Python 2.7, this is what will make your life a lot easier:
1. Install setuptools:
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg -O setuptools.egg
2. Install pip via easyinstall:
This will install pip as pip-2.7 for you and make the rest of your adventures easier.
Typically a binary of /usr/bin/pip might exist as well. To see what Python version it’s currently linked to, do this:
# pip –version
The output is pretty self-explanatory:
pip 0.3.1 from /usr/lib/python2.6/dist-packages (python 2.6)
To change this to 2.7, do this:
rm -rf /usr/bin/pip
ln -s /usr/local/bin/pip-2.7 /usr/bin/pip
This will now link pip to your 2.7 installation.