Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have 2 python instance on a CentOS machine, i.e. /usr/bin/python2.4 and /usr/bin/python2.7.

Modules for 2.4 are in /usr/lib/python2.4, and modules for 2.7 are in /usr/local/python27.

When I do yum install numpy, which I want to install for python2.7, it automatically install for python2.4.

How can I appoint which instance to install modules for with yum, easy_install and pip?

share|improve this question
add comment

1 Answer 1

Your yum probably only has packages for the Python version that is used by the OS (it is possible to share, package-manager installed, native python modules between different versions but it is more difficult to configure).

The best option for you is install pip for your /usr/local/python27 by downloading get-pip.py as per the manual and then running it with the python2.7 executable:

python2.7 get-pip.py

You only have to this once, and this will give you a command pip2.7 which you can use to install any package from PyPI into the Python 2.7 setup.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.