1,本机python2.7升级到3.6
一般老的虚机安装时python默认时2.7版本,需要升级
]# which python
/usr/bin/python
ls -lah /usr/bin/python
lrwxrwxrwx. 1 root root 7 Apr 22 2020 /usr/bin/python -> python2
安装python3.6后:
ls -lah /usr/bin/ |grep python
lrwxrwxrwx. 1 root root 7 Apr 22 2020 python -> python2
lrwxrwxrwx. 1 root root 9 Apr 22 2020 python2 -> python2.7
-rwxr-xr-x. 1 root root 7.1K Oct 31 2018 python2.7
lrwxrwxrwx. 1 root root 9 Feb 10 16:46 python3 -> python3.6
-rwxr-xr-x. 2 root root 12K Nov 17 2020 python3.6
-rwxr-xr-x. 2 root root 12K Nov 17 2020 python3.6m
升级为python3.6过程:
yum install epel-release yum install python36 cd /usr/bin/ 删除老软连接,创建新软连接 rm /usr/bin/python ln -s /usr/bin/python3.6 /usr/bin/python python --version