CentOS7安装Python3
下载地址
https://www.python.org/ftp/python/
安装依赖
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安装包到本地
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压安装包
tar -xvf 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
作者:合衬
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.