centos 安装python 3.6

1. 安装依赖

yum install -y libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

2. 下载python包

# 存放安装包的路径
cd /opt/install
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
# 解压
tar -zxvf Python-3.6.8.tgz

3. 编译

cd Python-3.6.8
./configure
make&&make install

4. 卸载

whereis python3 |xargs rm -frv

猜你喜欢

转载自blog.csdn.net/shlhhy/article/details/118360042