Premise: Just now I wanted to install a git in yum, and then reported this ghost.
Reason: When learning python, I changed the python2.7 that comes with centos7 to python3.6.2. And yum uses python2, so yum will report an error.
Solution:
Change the top line of the files /usr/bin/yum and /usr/libexec/urlgrabber-ext-down to #!/usr/bin/python2.7