Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Python

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following command to decompress the Python installation package:
    tar zxvf Python-2.7.16.tgz
  3. Run the following command to switch to the directory generated after the package is decompressed:
    cd Python-2.7.16
  4. Run the following command to perform configuration:
    CXX=g++ ./configure --prefix=/path/to/PYTHON
  5. Run the following command to perform compilation:
    make
    make install
  6. Run the following commands to set the Python environment variables:
    export PATH=/path/to/PYTHON/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/PYTHON/lib:$LD_LIBRARY_PATH
  7. Run the following command to check whether the installation is successful:
    python -V

    If information similar to the following is displayed, the installation is successful:

    Python 2.7.16