Installing Python
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following command to decompress the Python installation package:
tar zxvf Python-2.7.16.tgz
- Run the following command to switch to the directory generated after the package is decompressed:
cd Python-2.7.16
- Run the following command to perform configuration:
CXX=g++ ./configure --prefix=/path/to/PYTHON
- Run the following command to perform compilation:
make make install
- Run the following commands to set the Python environment variables:
export PATH=/path/to/PYTHON/bin:$PATH export LD_LIBRARY_PATH=/path/to/PYTHON/lib:$LD_LIBRARY_PATH
- Run the following command to check whether the installation is successful:
python -V
If information similar to the following is displayed, the installation is successful:
Python 2.7.16
Parent topic: Configuring the Compilation Environment