Monday, June 23, 2014

Build python virtual environment.

You don't need root previledge at all. This tutorial will help you understand how to install software on linux without root.

What is virtualen: 

This article is very helpful.

Install virtualenv +pip : 

follow this stackoverflow post, answer by Walker-Hale IV.
after you install the virtualenv, your prompt should look like:
and you "which python" should be the one in your virtualenv, because it made a copy of it.

NOTE, don't move the folder of the virtualenv ( py-en0 ) around, some setting are using ABSOLUTE path.


Install openblas: 

NUMPY and SCIPY are optimized using blas, lapack package, you can install openblas to get everything, and openblas has many other favorable features. 

I need to install a local library of openblas, so first thing is to make a .local directory:
"
cd
mkdir .local
"
then in any folder, download openblas from github ( to do this you need to have git)
"
git clone git://github.com/xianyi/OpenBLAS
"
then cd into openblas folder: 
make FC=gfortran
sudo make PREFIX=$HOME/.local install 
after this your openblas library is install in $HOME/.local/lib

install numpy: 

From this point on, I follow this post:

for the site.cfg: 
[default] 
library_dirs=$HOME/.local/openblas-base

[atlas]
atlas_libs=openblas
"
and you can aslo install scipy following it. 

To test, you can do: 
"
python -c "import numpy.core._dotblas"
"
if the import is successful, your numpy is using the right openblas .




No comments:

Post a Comment