Installing Python 2
Procedure
- Use PuTTY to log in to the server as the root user.
- Download the installation package.
cd /path/to/Python2 wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
- Decompress the installation package.
tar xvf Python-2.7.18.tgz
- Install the dependencies.
yum install gcc libffi* openssl libssl zlib* bzip2
- Install Python.
cd Python-2.7.18 ./configure --prefix=/path/to/Python-2.7.18-install --with-ensurepip=install make make install
- Load the environment variables.
export PATH=/path/to/Python-2.7.18-install/bin:$PATH export LD_LIBRARY_PATH=/path/to/Python-2.7.18-install/lib:$LD_LIBRARY_PATH export INCLUDE=/path/to/Python-2.7.18-install/include:$INCLUDE
Parent topic: Configuring the Compilation Environment