Skip to content

Cetnos6 Installing Python2.7

liuyu105 edited this page Mar 19, 2017 · 1 revision

Install dependencies

yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel libffi-devel nginx mysql-devel libcurl-devel

Compile Python

cd /opt
wget --no-check-certificate https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
tar xf Python-2.7.13.tar.xz
cd Python-2.7.10
./configure --prefix=/usr/local
make && make altinstall

ln -s /usr/local/bin/python2.7 /usr/local/bin/python

Installing and configuring distribute (python setuptools)

wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
/usr/local/bin/python2.7 ez_setup.py
/usr/local/bin/easy_install-2.7 pip
pip2.7 install virtualenv
Clone this wiki locally