Liunx环境准备
yum update -y
yum -y install gcc automake autoconf libtool make zlib* readline-devel
python 安装包国内镜像
https://registry.npmmirror.com/binary.html?path=python/
选择合适版本
下载python安装包
wget https://registry.npmmirror.com/-/binary/python/3.6.9/Python-3.6.9.tgz
创建安装目录
mkdir -p /usr/local/python3
解压安装
tar -zxvf Python-3***.tgz
cd Python-3.*.*
./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
测试安装
[root@centos-1 ~]# python3 --version
Python 3.6.15
网友评论