Installing Python
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following command to install the dependencies required by Python:
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
- Run the following command to decompress the Python installation package:
tar -xvf Python-3.6.3.tgz
- Run the following command to switch to the directory containing the decompressed files:
cd Python-3.6.3
- Run the following command perform configuration:
./configure --prefix=/path/to/PYTHON3
- Run the following commands to perform compilation and installation:
make -j make install
- Run the following commands to set the Python environment variables:
export PATH=/path/to/PYTHON3/bin:$PATH export LD_LIBRARY_PATH=/path/to/PYTHON3/lib:$LD_LIBRARY_PATH
Parent topic: Configuring the Compilation Environment