*非必要执行代码
yum -y install Development Libraries Development Tools
安装Python3相关依赖包
yum -y install zlib zlib-devel;
yum -y install bzip2 bzip2-devel;
yum -y install ncurses ncurses-devel;
yum -y install readline readline-devel;
yum -y install openssl openssl-devel;
yum -y install openssl-static;
yum -y install xz lzma xz-devel;
yum -y install sqlite sqlite-devel;
yum -y install gdbm gdbm-devel;
yum -y install tk tk-devel;
yum -y install libffi libffi-devel;
yum -y install libpcap libpcap-devel;
yum -y install db4 db4-devel;
下载Python3.7.2安装包
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
解压,编译,安装
tar -zxvf Python-3.7.2.tgz;
cd Python-3.7.2;
./configure;
make && make install;
配置选项 ./configure --enable-optimizations 用于提高Python安装后的性能
***************************************************************************************************************
配置yum
若更改了python软链接,导致yum不能正常使用,需要编辑yum的配置文件:
vim /usr/bin/yum
同时修改
vim /usr/libexec/urlgrabber-ext-down
将 #!/usr/bin/python 修改为 #!/usr/bin/python2.7
**********************************************************************************************************************