Installing numpy on Red Hat 6?

solvingPuzzles picture solvingPuzzles · Jul 31, 2012 · Viewed 8k times · Source

I'm trying to install numpy on a Red Hat (RHEL6) 64-bit linux machine that has Python 2.7. I downloaded and untar'd numpy 1.6.2 from Sourceforge, and I did the following commands in the numpy-1.6.2 folder:

python ./setup.py build
sudo python ./setup.py install #without sudo, this gives a permissions error.

Then, when I do import numpy on the Python prompt, I get ImportError: No module named numpy.

I read somewhere that numpy 1.6.2 is for Python 3.x, so I also tried the above steps with numpy 1.5.1, and I got the same ImportError.

I'm speculating that the solution lies in some environment variable gymnastics, but I'm not sure what files/directories Python needs to "see" that isn't in scope. Any suggestions for how to get numpy working?

I also tried some precompiled binaries for RHEL, but they gave various errors when I did sudo yum install [numpy precompiled binary url].rpm.

As an aside, my motivation for installing numpy is to use PyGnuplot. Also, I've installed numpy and PyGnuplot on other machines before, but it's been on Ubuntu and Mac OS.

Answer

morxa picture morxa · Oct 21, 2016

RHEL6 ships numpy 1.4.1, see distrowatch. If 1.4.1 is new enough for you, you can install it with:

$ yum install numpy