源码安装python3和yum配置1.下载pythonwgethttps://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgztar-zxvfPython-3.7.3.tgzcdPython-3.7.3.tgzcdsrc2。安装依赖yum-yinstallgccopenssl-develreadlinereadline-develzlib-devellibffi-devel3。编译安装./configure--prefix=/usr/local/soft/python3--with-sslmake&&makeinstallcd/usr/local/soft/python3/bin./python3.74.配置环境变量可选vim/etc/profile.d/python3.shexportPYTHON_HOME=/usr/local/soft/python3exportPATH=$PYTHON_HOME/binpython35。更改默认python版本mv/usr/bin/python/usr/bin/python2.7.5ln-s/usr/local/soft/python/bin/python3.7/usr/bin/pythonpython-VPython3.7.36。配置yum替换默认python版本后,yum无法使用vim/usr/bin/yum修改第一行#!/usr/bin/python==>#!/usr/bin/python2。7.5还有一个地方修改vim/usr/libexec/urlgrabber-ext-down#!/usr/bin/python==>#!/usr/bin/python2.7.5yum可以正常使用
