Centos7 instala python 2.7.15 y pip

Centos7 instala python 2.7.15 y pip

1. Primero instale el paquete GCC. Si el paquete GCC no está instalado, ingrese la siguiente línea de comando para instalar;
yum install gcc openssl-devel bzip2-devel
2. Use wget para descargar python 2.7 y descomprímalo
. Si no hay wget, primero instale wget con el siguiente comando;
yum- y instale wget  
en el directorio / usr / src y luego use wget para descargar python 2.7
cd / usr / src
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
  y descomprima python2. 7
tar -zxvf Python-2.7.15.tgz
3. Instale python 2.7
en el archivo descomprimido de Python-2.7.15 anterior y use la siguiente línea de comando para instalar
cd Python-2.7.15
./configure --enable-optimizations
make altinstall
4 Verifique la versión instalada de
python -V,
  puede ver la salida Python 2.7.15 y la instalación está completa.

5 、 安装 PIP
curl “https://bootstrap.pypa.io/get-pip.py” -o “get-pip.py”
python2.7 get-pip.py

Puede consultar el documento del gran dios
https://www.linuxidc.com/Linux/2016-04/130418.htm

Supongo que te gusta

Origin blog.csdn.net/smileui/article/details/106737860
Recomendado
Clasificación