Call me hardcore, but yes I ran a crazy command:

emerge --depclean

The effect was I lost my python2.6  and all applications that depend on that, including emerge. After a careful examination, I found out that I had 2 Python versions installed: python2.7 and python3.1.

Here’s what I do to fix this:

  1. Rename the
    /usr/bin/python
    and
    /usr/bin/python2
    into
    /usr/bin/python.old
    and
    /usr/bin/python2.old
    . This is because both of them is actually a symlink to
    /usr/bin/python-wrapper
    that select non-existent python2.6.
    mv /usr/bin/python /usr/bin/python.old
    mv /usr/bin/python2 /usr/bin/python2.old
    
  2. Make a symlink from python2.7 to python and python2.
    ln -s /usr/bin/python2.7 /usr/bin/python
    ln -s /usr/bin/python2.7 /usr/bin/python2
    
  3. Then, do eselect to select one of the available python. I’m a hardcore, I select the pyhon3.1: (you may choose python2.7 for the safest bet)
    eselect python set python2.7
    
  4. Build your packages accordingly.

When I said Python3 is hardcore, it IS a hardcore choice. Many packages failed to build using this thing. So, please, don’t use it if you don’t want to run into deep trouble.

Many sane solutions other than this solution can be read from this thread: http://forums.gentoo.org/viewtopic-t-786104-postdays-0-postorder-asc-start-25.html