- 准备编译环境
sudo yum groupinstall 'Development Tools' |
2.下载Python 3.6.1源码包
打开https://www.python.org/downloads/release/python-361/,下载XZ compressed source tarball
3.安装
3.1 创建安装文件的目录sudo mkdir /usr/local/python3
3.2 进入到下载的目录解压缩tar -Jxvf Python-3.6.1.tar.xz
3.3 配置./configure --prefix=/usr/local/python3
3.4 编译make
3.5安装sudo make install
4.安装后已自动做软链,无需再进行操作
5.pip做软链sudo ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip