cd /opt
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
3.安装python
tar xzf Python-3.6.1.tgz #解压
cd Python-3.6.1
./configure --wiht-ssl && make && make install # 编译安装,--wiht-ssl解决pip命令ssl报错问题
4.创建软连接
cd /usr/local/lib
ln -s /usr/local/bin/python3.6 python3 # 创建软连接
# 执行python3, 查看是否安装成功
python3
Python 3.6.1 (default, Mar 13 2020, 01:20:29)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>