I just want to add some line because sometimes it failed to install.
You can make a link to libpython2.7.so in your lib folder. So that if you have installed Python 2.7 and the version is still no right, use that suggestion. It wont hurt your CentOS 🙂
ln -s /opt/lib/libpython2.7.so /usr/lib/libpython2.7.so
all credits belongs to the great man that write this blog.