[root@localhost ~]# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz [root@localhost ~]# tar -xvJf Python-3.6.4.tar.xz [root@localhost ~]# cd Python-3.6.4/ [root@localhost Python-3.6.4]# ./configure prefix=/usr/local/python3 [root@localhost Python-3.6.4]# make && make install
安裝完畢,/usr/local/目錄下就會有python3了。python
[root@localhost Python-3.6.4]# ln -s /usr/local/python3/bin/python3 /usr/bin/python [root@localhost bin]# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip
[root@localhost bin]# vim /usr/bin/yum # 把#!/usr/bin/python 修改成 #!/usr/bin/python2
修改 /usr/bin/supervisord /usr/bin/echo_supervisord_conf /usr/bin/supervisorctl #!/usr/bin/python 改爲 #!/usr/bin/python2