关于CentOS 7升级Python到3.5后,yum出现的问题。
By
lincanbin
at 2016-05-14 • 0人收藏 • 8300人看过
CentOS 7升级Python到3.5后,我跟以前CentOS 6一样,在/usr/bin/python创建了一个指向Python 3的软连接,然后将/usr/bin/yum的顶部的:
#!/usr/bin/python
改成了
#!/usr/bin/python2.7
后,运行yum,还是出现了以下错误:
[root@vps ~]# yum -y install yum-priorities Loaded plugins: fastestmirror, langpacks Determining fastest mirrors * base: ftp.iij.ad.jp * epel: ftp.kddilabs.jp * epel-debuginfo: ftp.kddilabs.jp * epel-source: ftp.kddilabs.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax Exiting on user cancel
以前CentOS 6没这个问题的。
开了/usr/libexec/urlgrabber-ext-down看了下,发下他也使用了/usr/bin/python,于是跟前面一样,改为2.7,完成。
7 个回复 | 最后更新于 2016-05-14
登录后方可回帖
我觉得Debian好用