Installing Python
Procedure
- Use PuTTY to log in to the server as the root user.
- Decompress the Python-3.9.6 installation package.
cd /path/to/Python-3.9.6 tar -xvf Python-3.9.6.tgz
- Go to the directory generated after the decompression.
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/Python-3.9.6 --enable-shared --enable-optimizations make make install
- Configure the variables.
- Open the /etc/profile file.
vi /etc/profile
- 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
- Press Esc, type :wq!, and press Enter to save the settings and exit.
- Reload the environment variables.
source /etc/profile
- Open the /etc/profile file.
- View the version information.
python3 --version pip3 --version
If the correct version is displayed, the installation is successful.

Parent topic: Compilation and Installation