Reputation: 20856
I have installed Python 2.7 in my centos 6 linux box and when I install any packages using easy_install and pip install its installing in Python2.7...I need to install few packages in my default Python2.6 and how do I do that?
Upvotes: 0
Views: 1675
Reputation: 8009
You can check your pip version and which python it is pointed to
pip --version
That should give you some information about what to expect when calling pip. If you have pip 0.8 or better you can try pip-{version}
.
pip-2.6 install some-package-you-want-in-2.6
pip-2.7 install some-package-you-want-in-2.7
If you are still having problems you are calling the correct version of python. Check that your $PYTHON_PATH env var points to Python 2.6.
echo $PYTHON_PATH
Will tell you where it is pointed at now. The value is likely set in your ~/.bashrc file. If that comes back blank you should set the PYTHON_PATH variable so you can easily configure what Python you are calling from the shell. Without the variable you shell will call the python linked in /usr/bin, changing the symlinking in /usr/bin which might give you headaches down the road because you'll be altering global behavior in your system.
Upvotes: 1