'EC2 Amazon Linux: uninstalled Python2.7 by mistake and yum didn't work

I got a new EC2 amazon Linux server and a stupid action i was taken is to deinstalled python2.7. As a result my yum didn't work. What I still have is python3.7. I tried to edit /usr/bin/yum to change the quote of python to python3 but there are more issues popped up. I tried to get my python2.7 back using rpm -ivh. I downloaded the rpm packages to my local directory and it took ages to mange the dependancies. and i couldn't get it back successfully Can someone please give me some light with regards to what should I do in this case? after all i need Yum



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source