Last active
August 26, 2016 14:43
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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