1.下载python3:
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
2.解压
tar -zxvf Python-3.7.4.tgz
安装依赖:
安装3.7之前,先安装一下:
yum install libffi-devel -y
要不然会报错:python3 No module named '_ctypes'
3.编译安装
mkdir -p /usr/local/python3cd Python-3.7.4./configure --prefix=/usr/local/python3makesudo make install
4.建立软链接
sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3sudo ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
Python3的安装工作基本完成