Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Python 2

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Download the installation package.
    cd /path/to/Python2
    wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
  3. Decompress the installation package.
    tar xvf Python-2.7.18.tgz
  4. Install the dependencies.
    yum install gcc libffi* openssl libssl zlib* bzip2
  5. Install Python.
    cd Python-2.7.18
    ./configure --prefix=/path/to/Python-2.7.18-install --with-ensurepip=install
    make
    make install
  6. Load the environment variables.
    export PATH=/path/to/Python-2.7.18-install/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/Python-2.7.18-install/lib:$LD_LIBRARY_PATH
    export INCLUDE=/path/to/Python-2.7.18-install/include:$INCLUDE