准备安装环境
yum groupinstall 'Development Tools'
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel
下载并解压python3.6.1版本
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar zxvf Python-3.6.1.tgz
编译安装
cd Python-3.6.1
./configure --prefix=/usr/local/python3
make && make install
设置环境变量
echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc
重启shell
exec $SHELL
现在就可以使用python3和pip3了
python3
pip3