在CentOS上安装python3.7.0

在CentOS上安装python3.7.0

下载3.7.0安装包

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

1、安装编译器:
yum -y install gcc gcc-c++

2、安装python3依赖:
yum -y install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel
(各版本需安装依赖不同,具体可参考[https://github.com/pyenv/pyenv/wiki/Common-build-problems])
yum -y install libffi-devel
(python3.7以上版本还需安装此依赖)

3、安装:

tar -xf Python-3.7.0.tgz 
cd Python-3.7.0/
./configure --profix=/usr/python
make && make install

4、建立快捷方式:

ln -s /usr/python/bin/python3 /usr/bin/python3

安装完成

你可能感兴趣的:(在CentOS上安装python3.7.0)