yum方式
yum install python3 [[email protected] ~]# python -V Python 2.7.5 [[email protected] ~]# python3 -V Python 3.6.8 [[email protected] bin]# cd /usr/bin/ [[email protected] bin]# mv python python.bak [[email protected] bin]# ln -s python3.6 python [[email protected] bin]# python -V Python 3.6.8
当升级完后你会发现yum安装会出现如下错误
[[email protected] bin]# yum -y install lrzsz File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax
原因:因为yum要使用python2才可以运行
vim /usr/bin/yum vim /usr/libexec/urlgrabber-ext-down
将两个文件的最上面/usr/bin/python修改成/usr/bin/python2
原文地址:https://www.cnblogs.com/HByang/p/12669662.html
时间: 2024-11-09 03:00:30