Created
August 6, 2015 09:45
-
-
Save andriisoldatenko/5e639edfb71fb15f6a6e to your computer and use it in GitHub Desktop.
Install local python on CentOS
This file contains 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
#set -x | |
TMP_PATH=~/tmp_install_python | |
PYTHON_MAJOR=2.7 | |
PYTHON_VERSION=$PYTHON_MAJOR.10 | |
SETUPTOOLS_VERSION=18.1 | |
mkdir $TMP_PATH | |
cd $TMP_PATH | |
# Some comment | |
yum -y update | |
yum groupinstall -y development | |
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel | |
wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | |
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-$SETUPTOOLS_VERSION.tar.gz | |
tar -zxvf Python-$PYTHON_VERSION.tgz | |
tar -xvf setuptools-$SETUPTOOLS_VERSION.tar.gz | |
cd $TMP_PATH/Python-$PYTHON_VERSION | |
./configure --prefix=/usr/local | |
make && make altinstall | |
export PATH="/usr/local/bin:$PATH" | |
cd $TMP_PATH/setuptools-$SETUPTOOLS_VERSION | |
$PYTHON_MAJOR setup.py install | |
curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python$PYTHON_MAJOR - | |
rm -rf $TMP_PATH | |
ln -sf /usr/local/bin/python2.7 /usr/local/bin/python |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment