如何在没有root权限的情况下安装numpy 和scipy python module

参考:
http://www.hongliangjie.com/2012/04/01/install-numpy-and-scipy-on-centos-without-root-privilege/

Sometimes you want to install Numpy and Scipy on a remote CentOS machine without root privilege, which is usually true when you are using a university server. Before you proceed to the following instructions, you need to make sure that a copy of Python is installed. This is also done without root privilege, meaning that you may install it in an alternative directory, rather than system directory.

Prerequisite:

Download the latest version of LAPACK and extracted it into path [LAPACK].
Download the latest version of BLAS and extracted it into path [BLAS].
Note that in almost all tutorials on how to install Numpy and Scipy on Linux machines discuss how to install them with ATALS. This is possible only if you have the root privilege where you can turn off CPU threshoding . Since we do not have root privilege, we can only install them with LAPACK and BLAS.

Step 1: Install Numpy

Edit “site.cfg”

  • a) Enable “[DEFAULT]” section and add
    src_dirs = [BLAS]:[LAPACK]
  • b) Add

[blas_opt]
libraries = f77blas, cblas

[lapack_opt]
libraries = lapack, f77blas, cblas
Type the following command in the shell:

  • python setup.py build –fcompiler=gnu95

which will compile the package with “gfortran”.

Type the following command in the shell:

  • python setup.py install

Step 2: Install Scipy

Once Numpy is installed. Scipy can be easily built and installed through normal “python setup.py build” and “python setup.py install” process. Remember that these command should be accompanied with “–fcompiler=gnu95″.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值