1.非常重要!必须得先安装py3所依赖的软件包,否则可能会出现py3安装成功,却缺少相应的pip
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
2 .wegt下载py3源码 或者自己去官网下载源码包
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
3. 解压文件,需要在文件所在的文件夹下执行,具体的文件名请根据下载下来的文件
tar -zxvf Python-3.6.2.tgz
cd Python-3.6.2
./configure --prefix=/usr/local/python3.6
5 .先使用make命令编译以及链接文件,然后使用make install命令安装
6. 将python3添加进入环境变量
ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip3