After an unknown upgrade all gentoo related binary where replace by easy_install : cat /usr/bin/emerge #!/usr/bin/python2.7 # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==12.4','console_scripts','easy_install' __requires__ = 'setuptools==12.4' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('setuptools==12.4', 'console_scripts', 'easy_install')() ) reemerging portage didn't fix the problem. the problem was fixed by reemerging python-exec with an old emerge main script, then emerging portage : /mnt/oldgentoo/usr/bin/emerge --unmerge python-exec /mnt/oldgentoo/usr/bin/emerge -av python-exec /mnt/oldgentoo/usr/bin/emerge -av portage irc user @DrEeevil pointed to me that I should have not run pip as root ... And that we can maybe open a bug report to prevent pip doing such things. Reproducible: Didn't try
I dont really know where to assign this. but in general, updating things outside of the package manager can lead to broken systems.
For future reference, if python-exec is broken like this, the way to fix it is to invoke the emerge script directly. For example: python2.7 /usr/lib/python-exec/python2.7/emerge --oneshot dev-lang/python-exec:2
I'm surprised we don't have a bug open about this already.
This was fixed at some point in the past by patching distutils not to rewrite files in place.