def _activate(self):
old_syspath = set(sys.path)<EOL>site.addsitedir(self.site_path)<EOL>site.addsitedir(self.bin_path)<EOL>new_syspaths = set(sys.path) - old_syspath<EOL>for path in new_syspaths:<EOL><INDENT>sys.path.remove(path)<EOL>sys.path.insert(<NUM_LIT:1>, path)<EOL><DEDENT>if not hasattr(sys, '<STR_LIT>'):<EOL><INDENT>sys.real_prefix = sys.prefix<EOL><DEDENT>sys.prefix = self.path<EOL>
Do some serious mangling to the current python environment...
This is necessary to activate an environment via python.