Skip to content

Instantly share code, notes, and snippets.

@jkbrzt
Last active August 26, 2016 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkbrzt/0ecbd7601ea168321391 to your computer and use it in GitHub Desktop.
Save jkbrzt/0ecbd7601ea168321391 to your computer and use it in GitHub Desktop.
Download, compile, and install Python on RHEL or CentOS. Tested with CentOS 6 + Python 2.7.3 and CentOS 7 + Python 3.4.1
VERSION="3.4.1"
yum -y install gcc openssl-devel
rm -rf Python-${VERSION}*
wget https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz
tar -xvzf Python-${VERSION}.tgz
cd Python-${VERSION}
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
echo "/usr/local/lib" > /etc/ld.so.conf.d/custom-python.conf
make && make altinstall
echo "Done!"
ls -l /usr/local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment