Installing Python
Procedure
- Use PuTTY to log in to the server as the root user.
- Download the Python installation package.
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
- Decompress the package.
tar -xvf Python-3.9.6.tgz
- Install the dependencies.
yum install gcc libffi* openssl libssl zlib* bzip2
- Perform the configuration.
./configure --prefix=/path/to/PYTHON --enable-shared --enable-optimizations
- Perform the compilation and installation.
make make install
- Configure the environment variables.
export PATH=/path/to/PYTHON:$PATH export LD_LIBRARY_PATH=/path/to/PYTHON:$ LD_LIBRARY_PATH
- Verify the version.
python3 --version pip3 --version
If a version number is displayed in the command output, the installation is successful.
Parent topic: Configuring the Compilation Environment