Python2与Python3同时存在
Go Go Go
一:下载
wget -c https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar -xvzf Python-3.7.1.tgz
cd Python-3.7.1/
二:验证
先看一下有没有安装
openssl-devel,gcc,zlib,libffi-devel
没有话,安装
rpm -aq|grep openssl
yum install openssl-devel -y
yum -y install gcc
yum -y install zlib*
yum install libffi-devel -y
三:编译安装
./configure --prefix=/usr/python37 --with-ssl
make && make install
四:增加一个软链
ln -s /usr/python37/bin/python3 /usr/bin/python3
ln -s /usr/python37/bin/pip3 /usr/bin/pip3
五:运行
python3