简单记录下安装的关键点及注意事项
- 源码准备
# 下载源码
cd /tmp
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
# 解压
tar -xvzf Python-3.7.0.tgz
- 安装依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
# 3.7需新依赖
yum -y install libffi-devel
- 安装
cd Python-3.7.0
# 指定安装目录
./configure --prefix=/usr/local/python3
# 编译安装
make && make install
- 建立软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3