Centos7 install python 2.7.15 and pip
1. Install the GCC package first. If the GCC package is not installed, enter the following command line to install;
yum install gcc openssl-devel bzip2-devel
2. Use wget to download python 2.7 and decompress
it. If there is no wget, use the following command to install wget;
yum- y install wget
enter the directory /usr/src and use wget to download python 2.7
cd /usr/src
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
and unzip python2. 7
tar -zxvf Python-2.7.15.tgz
3. Install python 2.7
into the Python-2.7.15 decompressed file above and use the following command line to install
cd Python-2.7.15
./configure --enable-optimizations
make altinstall
4 . Check the installed version of
python -V,
you can see the output Python 2.7.15 and the installation is complete.
5、安装 PIP
curl “https://bootstrap.pypa.io/get-pip.py” -o “get-pip.py”
python2.7 get-pip.py
You can refer to the document of the great god
https://www.linuxidc.com/Linux/2016-04/130418.htm