centos7安装python3
原创
©著作权归作者所有:来自51CTO博客作者RoyFans的原创作品,请联系作者获取转载授权,否则将追究法律责任
1.准备安装工具
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-develtk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2.下载python3源码
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
3.解压
tar xf Python-3.7.5.tgz ./
4.进入下载目录
5.编译
./configure --prefix=/usr/local/python3
make&& make install
6.创建软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3