- 依赖
yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
- 解压包
tar -xvf Python-3.6.6.tgz
- 编译安装
cd Python-3.6.6 # 进入源码包文件夹
mkdir /usr/local/python3
./configure --prefix=/usr/local/python3 #一般用来生成 Makefile,为下一步的编译做准备
make && make install
- 创建软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3