Tuesday, July 24, 2012

How to install Numpy and Scipy in Ubuntu without root right

During my research working, I need to install 'matplot' in Ipython; however, the newest version of matplot requires latest version of Numpy and Scipy. Since I am using the university computer, Ubuntu 10.10, and Numpy and Scipy is very old. So I try to manage to update the later version of Numpy and Scipy.

  1. Numpy install:

  2. Here we basically follow the instruction of the instruction on the webpage"http://www.hongliangjie.com/2012/04/01/install-numpy-and-scipy-on-centos-without-root-privilege/"

    Notice that here you have to install LAPAC and BLAS correctly before you install NUmpy. You can find some instruction about LAPAC and BLAS installation also from the link above.
  1. Scipy install:
       Installation of Scipy is a little bit tricky. First, I failed because I cannot manage to change the installation directory. Then with the help of Michael yesterday, he did it.
  • Copy the 'site.cfg' to the untared directory file folder of scipy, say in my case 'scipy-0.10.1'. 
  • You have to make sure in which directory installed your python library. This is why I failed before. Michael somehow is experienced to that, and he find it out. So open the site.cfg and change the lines under '[Default]':
        [DEFAULT]
      library_dirs = /usr/lib
      include_dirs = /usr/include
      src_dirs = [BLAS]:[LAPACK]
  •  Under the folder of 'scipy-0.10.1' in your terminal, you have to make sure to build with either gfortran or g77 complier, in my case I use gfortran, so you type:
       python setup.py build --fcomplier=gfortran
  •  Then you can install scipy in your local computer:
        python setup.py install --home=~

No comments:

Post a Comment