David542
David542

Reputation: 110093

Installing pip with correct python version

I am on shared hosting and I need to install pip with the correct python version, 2.7. To install pip, I did:

$ easy_install pip

However, after it was installed I get the following:

[dave@web1 lib]$ pip --version
pip 1.0.2 from /home/premiere/dave/financials/lib/pip-1.0.2-py2.7.egg (python 2.4)

How would I re-install pip to work on the python2.7 version, which is also installed on the machine?

[premiered@web1 ~]$ python --version
Python 2.6.6

Which is strange, since it is installing to python2.4.

Upvotes: 1

Views: 3819

Answers (2)

MarkHu
MarkHu

Reputation: 1849

If multiple versions of python are installed on the system, then you should invoke the version you want when installing. i.e.

$ python27 easy_install pip

This creates a pip file in your path that contains the specified version of python in the hashBang line.

Upvotes: 0

Felix Yan
Felix Yan

Reputation: 15259

You may want to create a virtualenv using -p /path/to/python-2.7.binary param, and then activate it. Then all stuff you installed using pip would be correctly into your virtualenv.

Upvotes: 1

Related Questions