[root@ansible soft]# yum install gcc gcc-c++ -y
[root@ansiblesoft]# wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
[root@ansible soft]# tar xvf Python-3.7.3.tar.xz
[root@ansible soft]# cd Python-3.7.3/
[root@ansible Python-3.7.3]# ./configure --prefix=/usr/local/python3
[root@ansible Python-3.7.3]# make && make install
[root@ansible Python-3.7.3]# python -V
安装pip
Python-3.7.3/Modules/Setup.dist找到下面这句,去掉注释
#zlib zlibmodule.c -I(prefix)/include−L(prefix)/include−L(exec_prefix)/lib -lz
zlib zlibmodule.c -I(prefix)/include−L(prefix)/include−L(exec_prefix)/lib -lz
yum -y install zlib*
[root@wangzy Python]# make && make install
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
正在上传…重新上传取消
python -m ensurepip
ModuleNotFoundError: No module named '_ssl'