Centos 7 安装python3.7.1

  1. 下载源代码并拷贝到系统,略
  2. 解压缩源码包
tar zxvf Python-3.7.1.tgz
  1. 安装编译依赖环境
yum install libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y
  1. 进入源代码目录下,依次执行如下命令
cd /opt/Python-3.7.1
./configure prefix=/usr/local/python3
make && make install
  1. 创建软连接
#添加python3的软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
  1. 查看一下版本
python3 -V

Python 3.7.1

你可能感兴趣的:(Centos 7 安装python3.7.1)