首页 > 系统相关 >python升级带来的yum异常:File

python升级带来的yum异常:File

时间:2022-12-08 21:01:51浏览次数:50  
标签:bin python python2.7 down yum usr File


CentOS 7升级Python到3.5。2后,需要在/usr/bin/python创建了一个指向Python 3的软连接,然后将/usr/bin/yum的顶部的:

!/usr/bin/python

改成了

!/usr/bin/python2.7

后,运行yum,还是出现了以下错误:

[root@master ~]# yum -y groupinstall “X Window System”

 

 File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax

 

解决方案:

 

1.

 

vim /usr/libexec/urlgrabber-ext-down

将/usr/bin/python改为/usr/bin/python2.7。

2.

 

vim /usr/bin/yum-config-manager

解决办法同上: #!/usr/bin/python换成 #!/usr/bin/python2.7  

标签:bin,python,python2.7,down,yum,usr,File
From: https://blog.51cto.com/u_13991401/5923468

相关文章