Google Cloud install python3 (in CentOS)

whereis python
cd /usr/bin
ll python*
 
1. 安装依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
 
2. 安装pip
#运行这个命令添加epel扩展源 yum -y install epel-release #安装pip yum install python-pip
 
3. 安装wget
pip install wget
 
4. wget下载python3源码包
 
5. 编译python3源码包
tar -zxvf Python-3.8.4.tgz
./configure prefix=/usr/local/python3 make && make install
 
6. 添加软链接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
# 测试是否安装成功
python3 -V
 
 
Total download size: 10 M
Installed size: 26 M
Is this ok [y/d/N]:
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2020-07-14.09-42.3PJ6UP.yumtx
 
 
 
 
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
The program yum-complete-transaction is found in the yum-utils package.
 
 


原文地址:https://www.cnblogs.com/jilili/p/14449601.html