1. 过程
# 1. root权限, 安装依赖
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 gcc-c++
# 2. 从 https://www.python.org/ftp/python/ 下载对应版本
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
# 3. 创建 Python 3 目录
mkdir /usr/local/python3
# 4. 解压下载文件并切换目录
tar -zxvf Python-3.6.4.tgz
cd Python-3.6.4/
# 5. 执行
./configure --prefix=/usr/local/python3
make && make install
# 6. 创建Python3的软链接, 创建Pip3的软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
参考:https://blog.csdn.net/x_koozal/article/details/72432906
原文地址:https://www.cnblogs.com/HurryXin/p/8955099.html
时间: 2024-11-06 03:38:06