brsbilgic
brsbilgic

Reputation: 11833

python 2.4 and python 2.7 path conflict

I try to install python 2.7 on centos which has 2.4 on it. I have read many documents and try to apply them but there are still many conflicts. I am a user with sudo grant. When I write python, it runs python 2.7.1 from the location /opt/python2.7.1/bin however, when I try to install setuptools as python setup.py install it is installed under /usr/local/bin.

What can be the problem? Shouldn't it be in /opt/python2.7.1./bin ?

Note: I have updated my .bash_profile

Upvotes: 0

Views: 1023

Answers (1)

Keith
Keith

Reputation: 43024

When you have multiple versions of Python installed you must then also specify the version you want when you invoke it. On CentOS the default Python is 2.4, and is named just "python". So when you install with "python ..." you will be running with 2.4, and it will try to install in the 2.4 site-packages directory. In order to get it installed for 2.7 you must use "python2.7 ..." to install.

Python uses built-in variables to determine where it lives and installs things. What is the output of:

python2.7 -c "import sys; print sys.prefix"

Upvotes: 1

Related Questions