Installing Numpy locally

Posted by Néstor on Super User See other posts from Super User or by Néstor
Published on 2012-06-05T00:46:21Z Indexed on 2012/06/05 4:44 UTC
Read the original article Hit count: 303

Filed under:
|
|

I posted this question originally on StackOverflow, but a user suggested I moved it here so here I go!

I have an account in a remote computer without root permissions and I needed to install a local version of Python (the remote computer has a version of Python that is incompatible with some codes I have), Numpy and Scipy there. I've been trying to install numpy locally since yesterday, with no success.

I successfully installed a local version of Python (2.7.3) in /home/myusername/.local/, so I access to this version of Python by doing /home/myusername/.local/bin/python. I tried two ways of installing Numpy:

  1. I downloaded the lastest stable version of Numpy from the official webpage, unpacked it, got into the unpacked folder and did: /home/myusername/.local/bin/python setup.py install --prefix=/home/myusername/.local. However, I get the following error, which is followed by a series of other errors (deriving from this one):

    gcc -pthread -shared build/temp.linux-x86_64-2.7/numpy/core/blasdot/_dotblas.o
    -L/usr/local/lib -Lbuild/temp.linux-x86_64-2.7 -lptf77blas -lptcblas -latlas 
    -o build/lib.linux-x86_64-2.7/numpy/core/_dotblas.so
    /usr/bin/ld: /usr/local/lib/libptcblas.a(cblas_dptgemm.o): relocation 
    R_X86_64_32 against `a local symbol' can not be used when making a shared 
    object; recompile with -fPIC
    

    Not really knowing what this meant (except that the error apparently has to do with the LAPACK library), I just did the same command as above, but now putting LDFLAGS='-fPIC', as suggested by the error i.e., I did LDFLAGS="-fPIC" /home/myusername/.local/bin/python setup.py install --prefix=/home/myusername/.local. However, I got the same error (except that the prefix -fPIC was addeded after the gcc command above).

  2. I tried installing it using pip, i.e., doing /home/myusername/.local/bin/pip install numpy /after successfully instaling pip in my local path). However, I get the exact same error.

I searched on the web, but none of the errors seemed to be similar to mine. My first guess is that this has to do with some piece of code that needs root permissions to be executed, or maybe with some problem with the version of the LAPACK libraries or with gcc (gcc version 4.1.2 is installed on the remote computer).

Help, anyone?

© Super User or respective owner

Related posts about installation

Related posts about python