There was a error importing one of the Python modules
Question: I am trying to run a yum command `# yum install mod-pagespeed` but I am
getting this error

> There was a problem importing one of the Python modules required to run yum.
> The error leading to this problem was:
>
> cannot import name Repository
>
> Please install a package which provides this module, or verify that the
> module is installed correctly.
>
> It's possible that the above module doesn't match the current version of
> Python, which is: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18) [GCC 4.4.7
> 20120313 (Red Hat 4.4.7-3)]
>
> If you cannot solve this problem yourself, please go to the yum faq at:
> <http://yum.baseurl.org/wiki/Faq>

Your help will be greatly appreciated


Answer: Did you upgrade the Python that's running on your system? It's possible that
it broke yum, as yum on older systems relied on the Python version being 2.4

Can you downgrade python back to 2.4 to get yum working again, then do an
alternate install of Python to a newer version, keeping both on your system?

See this link for procedures for installing alternate versions of python:
<https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-
centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only>

