Linux centos7安装python3并且不影响python2
一、安装依赖
yum -y groupinstall
"Development tools"
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 (3.7以上需要libffi-devel)
二、获取安装包 编译安装
cd
Python-3.6.4
.
/configure
--prefix=
/usr/local/python3
make
&&
make
install
三、创建软连接
ln
-s
/usr/local/python3/bin/python3
/usr/bin/python3
ln
-s
/usr/local/python3/bin/pip3
/usr/bin/pip3