Centos7 the python that is installed by default is version 2.7. I want to upgrade Python to version 3.5 because I want to install mysql-utilities.
Installing python3.5.6
# 安装python的依赖包 openssl openssl-devel libssl-devyum install -y openssl openssl-devel gcc libssl-devmkdir -p /usr/local/webserver/python /downloadcd /downloadwget https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tgztar xvf Python-3.5.6.tgzcd Python-3.5.6./configure --prefix=/usr/local/webserver/python --enable-optimizationsmake && make installcd /usr/local/webserver/python/./python3.5 -Vmv /usr/bin/python /usr/bin/python-2.7mv python3.5 /usr/bin/python
Other
If you cover/usr/bin/pytho with python3.5, there will be some problems, such as Yum not being used. This is because these commands use the python2.7, which can be used to find commands that use Python2.7 with the following command
grep -ai /usr/bin/python /usr/bin/* find /usr/bin -type f | xargs grep "/usr/bin/python"
Modify/usr/bin/python to/usr/bin/python-2.7
From for notes (Wiz)
Centos7 upgrading Python to 3.5.6