In pkg_postinst, the python ebuilds attempt to bytecompile the python modules in /usr/lib/python${PYVER} as well as in /usr/$(get_libdir)/python${PYVER}, which is incorrect when /usr/lib is not a symlink to /usr/$(get_libdir). The suspect part of the ebuild reads, in part: python_mod_optimize -x "(site-packages|test)" /usr/lib/python${PYVER} [[ "$(get_libdir)" != "lib" ]] && python_mod_optimize -x "(site-packages|test)" /usr/$(get_libdir)/python${PYVER} This causes the following output on postinst: Switching to python2.6 * //usr/lib/python2.6 doesn't exist! * Byte compiling python modules for python-2.6 .. ... [ ok ] * Byte compiling python modules for python-2.6 .. ... [ ok ] (and similar for python3.1) I would suggest just changing those two suspect lines in the ebuild to: python_mod_optimize -x "(site-packages|test)" /usr/$(get_libdir)/python${PYVER}
Fixed. I also fixed paths passed to python_mod_cleanup(). dev-lang/python-2.4.6 installs .py files always to /usr/lib.