您的位置:首页 > 编程语言 > Python开发

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

2015-06-03 14:55 856 查看
参考:

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″.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: