I.T. Security and Linux Administration

Jan 31 2013   2:34PM GMT

Manually installing pip



Posted by: Eric Hansen
Tags:
security

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
sh setuptools.egg

2. Install pip via easyinstall:

easy_install-2.7 pip

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.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: