Have you tried re-setting sys.argv before running setup (aka
sys.argv=['setup.py','--build'] ; run setup.py,local )?  If I'm
understanding the help for the pymol run command correctly, you'd want to
use either local or module (so that the global namespace doesn't confuse
things).

This may do strange things to your pymol install, and might not work, but
it seems like it would be worth a try.