These instructions were mostly taken from here, though I've modified them to install Python 2.7.15 and the latest setuptools
package.
# Install dependencies
yum groupinstall -y 'development tools'
yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget
# Download the Python source and unpack it
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
tar -xvzf Python-2.7.15.tgz
# Enter the directory, configure, and install
cd Python-2.7.15
./configure --prefix=/usr/local
make
make altinstall
# Check the Python version with `python2.7 -V` and make sure
# /usr/local/bin is in your `PATH` with `echo $PATH`. If not
# do `export PATH="/usr/local/bin:$PATH"`
# Install `setuptools`
cd ..
wget https://files.pythonhosted.org/packages/b0/d1/8acb42f391cba52e35b131e442e80deffbb8d0676b93261d761b1f0ef8fb/setuptools-40.6.2.zip
unzip setuptools-40.6.2.zip
cd setuptools-40.6.2
python2.7 setup.py install
# Install `pip`
curl https://bootstrap.pypa.io/get-pip.py | python2.7 -
# Install `virtualenv`
pip2.7 install virtualenv
Thanks!