Installing Python
Procedure
- Use PuTTY to log in to the server as the root user.
- Decompress the source package and go to the directory.
tar -xvf Python-3.9.6.tgz cd Python-3.9.6
- Install the dependencies.
yum install gcc libffi* openssl libssl zlib* bzip2
- Perform the compilation and installation.
./configure --prefix=/path/to/python3.9.6 --enable-shared --enable-optimizations make make install
- Set the environment variables.
export PATH=/path/to/python3.9.6/bin:$PATH export LD_LIBRARY_PATH=/path/to/python3.9.6/lib:$LD_LIBRARY_PATH
- Verify the version.
python3 --version pip3 --version
If a Python version number is displayed in the command output, the installation is successful.

Parent topic: Configuring the Compilation Environment