Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Python

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Decompress the Python-3.9.6 installation package.
    cd /path/to/Python-3.9.6
    tar -xvf Python-3.9.6.tgz
  3. Go to the directory generated after the decompression.
    cd Python-3.9.6
  4. Install the dependencies.
    yum install gcc libffi* openssl libssl zlib* bzip2
  5. Perform the compilation and installation.
    ./configure --prefix=/path/to/Python-3.9.6 --enable-shared --enable-optimizations
    make
    make install
  6. Configure the variables.
    1. Open the /etc/profile file.
      vi /etc/profile
    2. Press i to enter the edit mode and add the following content:
      export PATH=/path/to/Python-3.9.6/bin:$PATH
      export LD_LIBRARY_PATH=/path/to/Python-3.9.6/lib:$LD_LIBRARY_PATH
    3. Press Esc, type :wq!, and press Enter to save the settings and exit.
    4. Reload the environment variables.
      source /etc/profile
  7. View the version information.
    python3 --version
    pip3 --version

    If the correct version is displayed, the installation is successful.