Skip to content

Instantly share code, notes, and snippets.

Last active April 13, 2017 02:19
Show Gist options
  • Save kilfu0701/8294780 to your computer and use it in GitHub Desktop.
Save kilfu0701/8294780 to your computer and use it in GitHub Desktop.
install python 2.7.6 from source. ( CentOS )
## install deps if need
yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel
## if build from python src
cd ~
mkdir src
cd src
tar zxvf Python-2.7.6.tgz
cd Python-2.7.6
./configure --prefix=/opt/python2.7.6 --enable-shared
make test
make install
## make an alias
ln -s /opt/python2.7.6/bin/python /usr/bin/python2.7.6
ln -s /opt/python2.7.6/lib/python2.7/config/libpython2.7.a /usr/local/lib/
## set libs
echo "/opt/python2.7.6/lib/" > /etc/
## setuptools
cd ~/src/
wget -c "" -O setuptools.tar.gz
tar zxvf setuptools.tar.gz
cd pypa-setuptools-*/
python2.7.6 build
python2.7.6 install
## pip
cd ~/src/
wget -c --no-check-certificate
tar zxvf pip-1.5.tar.gz
cd pip-1.5
python2.7.6 build
python2.7.6 install
ln -s /opt/python2.7.6/bin/pip /usr/bin/pip-2.7.6
## install packages
pip-2.7.6 install django==1.5.4
pip-2.7.6 install django-htmlmin
cd ~/src/
wget -c --no-check-certificate "" -
O ""
cd MySQL-python-1.2.5
python2.7.6 build
python2.7.6 install
cd ~/src/
wget -c ""
tar zxvf beautifulsoup4-4.3.2.tar.gz
cd beautifulsoup4-4.3.2
python2.7.6 install
cd ~/src/
wget --no-check-certificate
tar zxvf python-dateutil-2.2.tar.gz
cd python-dateutil-2.2
python2.7.6 install
cd ~/src/
wget -c --no-check-certificate ""
tar zxvf python-Levenshtein-0.11.1.tar.gz
cd python-Levenshtein-0.11.1
python2.7.6 install
pip-2.7.6 install lxml
pip-2.7.6 install numpy
pip-2.7.6 install matplotlib
#cd ~/src/
#tar zxvf blas.tgz
#cd BLAS
#gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f
#ar r libfblas.a *.o
#ranlib libfblas.a
#export BLAS=~/src/BLAS/libfblas.a
#cd ~/src/
#tar zxf lapack.tgz
#cd lapack-*/
#cp INSTALL/ ./
#make lapacklib
#make clean
#export LAPACK=~/src/lapack-3.5.0/liblapack.a
yum install lapack lapack-devel blas blas-devel
pip-2.7.6 install scipy
pip-2.7.6 install ggplot
pip-2.7.6 install rpy2
## build mod_wsgi for python2.7.6
cd ~/src/
tar zxvf mod_wsgi-3.4.tar.gz
cd mod_wsgi-3.4
./configure --with-python=/opt/python2.7.6/bin/python
make install
Copy link

Is this procedure OK for CentOS 6, where python2.6.6 is the default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment