软件:
第一步:安装Python3环境
1.首先安装编译环境(后续需要从python官网获取Python3的源码自己编译python
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
2.从官网下载python3的源码
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
3.依次执行 解压>进入解压后的目录>编译安装
tar -xvJf Python-3.6.2.tar.xz
cd Python-3.6.2
./configure prefix=/usr/local/python3
make && make install
4.安装完毕,创建python3软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# 执行命令
python3 -V #将会看到python3的版本
# 执行命令
python -V #将会看到python2的版本
5.创建pip软连接
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
# 执行命令