预装的依赖
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
yum -y install libffi libffi-devel
1.下载python包
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz
2.解压
tar Jxvf Python-3.5.0.tar.xz
3.安装
cd Python-3.6.2
./configure --prefix=/usr/soft/python
make && make install
4.软连接
ln -s /usr/soft/python/bin/python3.6 /usr/local/bin/python3
5.升级pip
pip install --upgrade pip
输入python3 如果出现如下界面,说明配置成功