安装依赖环境:

yum install -y openssl-devel openssl-static zlib-devel lzma tk-devel xz-devel bzip2-devel ncurses-devel gdbm-devel readline-devel sqlite-devel gcc libffi-devel

下载Python3.7.0

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

将解压后文件夹迁移至/usr/local

mv Python-3.7.0 /usr/local

进入Python目录

cd /usr/local/Python-3.7.0/


执行配置文件

./configure

编译安装

make && make install

在/usr/bin路径下生成python3的软链接

ln -s /usr/local/Python-3.7.0/python /usr/bin/python3
ln -s /usr/local/Python-3.7.0/pip /usr/bin/pip3
Last modification:December 15th, 2019 at 11:13 am