Installation from python, numpy, scipy sources without root privileges on Linux

A memo about the procedure for the general public without root privileges to install the python2 series.

A word summary

Build from source.

Why you need it

Users with root privileges rarely need to think about this.

However, if you're just a person without root privileges, you can't even install a package that requires just one line, such as pip or easy_install (which is partly a lie: -p). Also, in the case of a shared machine environment, the point that you cannot upgrade the python version or add and update packages without permission is also a bottleneck.



Without this, you will be hurt later. reference:

# cd ~/tmp
# wget
# tar xzf bzip2-1.0.6.tar.gz
# cd bzip2-1.0.6
# make -f Makefile-libbz2_so
# make
# make install PREFIX=/home/akisato/src/downloads/bzip2-1.0.6
# export CFLAGS=-I/home/akisato/src/downloads/include
# export LDFLAGS=-L/home/akisato/src/downloads/lib

python body

Sometimes there are packages that require a dynamic link library like theano, so be careful. To avoid this problem, simply enable-shared with configure will have side effects, so specify -rpath to avoid it. [^ 1].

[^ 1]: It's probably okay, hoping that it hasn't been overwritten by the previous LDFLAGS.

# cd ~/tmp
# wget
# tar xzf Python-2.7.6rc1.tgz
# cd Python-2.7.6
# ./configure --prefix=/home/akisato/src/downloads/python-2.7.6rc1 --with-threads --enable-shared LDFLAGS=-Wl,-rpath,/home/akisato/src/downloards/python-2.7.6rc1/lib
# vi Makefile
# make
# make install
# export PATH=/home/akisato/src/downloads/python-2.7.6rc1/bin:${PATH}
# export PYTHONPATH=/home/akisato/src/downloads/python-2.7.6rc1/lib/python2.7/site-packages

It is better to write PATH and PYTHONPATH in ~ / .bashrc for later.


reference: Install numpy and scipy on CentOS 5.5 without using yum

# cd ~/tmp
# wget
# tar xzf blas.tgz
# cd BLAS
# gfortran -O3 -m64 -fPIC -c *.f
# ar r libfblas.a *.o
# ranlib libfblas.a
# rm -rf *.o
# cp libfblas.a /home/akisato/lib    #Copy to a place to leave permanently
# gfortran -O3 -m64 -fPIC -shared *.f -o
# cp /home/akisato/lib    #Copy to a place to leave permanently
# export BLAS=/home/akisato/lib/    #OK if you can see it only when installing scipy


# cd ~/tmp
# wget
# tar xzf lapack.tgz
# cd lapack
# vi
OPTS = -O2 -m64 -fPIC
NOOPT = -m64 -fPIC
# make lapacklib
# cp liblapack.a /home/akisato/lib    #Copy to a place to leave permanently
# export LAPACK=/home/akisato/lib/liblapack.a    #OK if you can see it only when installing scipy


It can be installed without BLAS and LAPACK, but it is better to see it if there is one. Please note that the python you just installed will not be used unless you set the path properly.

# which python
# wget --no-check-certificate
# tar xzf numpy-1.8.0.tar.gz
$ cd numpy-1.8.0
$ python build
$ python install


If the environment variables CFLAS, CCFLAGS, and LDFLAGS are set, it seems that the settings of the scipy build script will be overwritten, so it is better to delete them before build.

# unset CFLAGS
# unset CCFLAGS
# unset LDFLAGS
# wget
# tar xzvf scipy-0.14.0.tar.gz
# cd scipy-0.14.0
# python build
# python install


With this, you can easily install the python library with easy_install .

# cd ~/tmp
# wget --no-check-certificate
# tar xzf setuptools-3.4.1.tar.gz
# cd setuptools-3.4.1
# python


This is more convenient than easy_install.

# easy_install pip
# pip freeze
(OK if the already installed package is displayed)

If you can't install pip via easy_install, use

# wget --no-check-certificate
# python

Recommended Posts

Installation from python, numpy, scipy sources without root privileges on Linux
Stray build Python-3.8.5 on CentOS without root privileges
Install scipy on Linux without internet connection
Use Numpy, Scipy, scikit-learn on Amazon Linux
Install the python module with pip on a server without root privileges
Install and run Python3.5 + NumPy + SciPy on Windows 10
Update monitoring of dmesg (/ dev / kmsg) from python on Linux
Fastest Python installation on Windows
Install CaboCha without root privileges.
[Python + heroku] From the state without Python to displaying something on heroku (Part 1)
[Python + heroku] From the state without Python to displaying something on heroku (Part 2)
Install Python Pillow on Amazon Linux
Use Numpy, Scipy, scikit-learn on Heroku
Installation of SciPy and matplotlib (Python)
Installation of Python, SciPy, matplotlib (Windows)
Notes on accessing dashDB from python
If Python 3.5.0 installation fails on Mac
Introduce Python 3.5.2 environment on Amazon Linux
python> os.path.join ('data','checkpoint')>'data / checkpoint' on linux
Call C / C ++ from Python on Mac
Update Python on Mac from 2 to 3
Data integration from Python app on Linux to Amazon Redshift with ODBC