python版本问题,iotop执行错误except ImportError, e:解决

# iotop 
  File “/usr/sbin/iotop”, line 10
    except ImportError, e:
                      ^
SyntaxError: invalid syntax
[root@eanquan ~]# vi /usr/sbin/iotop 
#!/usr/bin/python
# iotop: Display I/O usage of processes in a top like UI
# Copyright (c) 2007, 2008 Guillaume Chazarain <guichaz@gmail.com>, GPLv2
# See iotop –help for some help

import sys

try:
    from iotop.ui import main
except ImportError, e:
    print e
    print ‘To run an uninstalled copy of iotop,’
    print ‘launch iotop.py in the top directory’
else:
    try:
        main()
    except KeyboardInterrupt:
        pass

    sys.exit(0)

# ll /usr/bin/python2*0 B/s  0.00 %  0.00 % [md/1]
lrwxrwxrwx. 1 root root       6 Jul  8  2016 /usr/bin/python2 -> python
-rwxr-xr-x. 2 root root    4864 Jan 22  2014 /usr/bin/python2.6
-rwxr-xr-x  1 root root 6273947 Dec  4  2017 /usr/bin/python2.7

执行python的#!/usr/bin/python 改为

#!/usr/bin/python2.6就可以