def _setup_py_run_from_dir(root_dir, py_interpreter):
data = {}<EOL>with _enter_single_subdir(root_dir) as single_subdir:<EOL><INDENT>if not os.path.exists("<STR_LIT>"):<EOL><INDENT>raise Exception("<STR_LIT>" % (<EOL>single_subdir))<EOL><DEDENT>output_json = tempfile.NamedTemporaryFile()<EOL>cmd = "<STR_LIT>""<STR_LIT>" % (py_interpreter, output_json.name)<EOL>try:<EOL><INDENT>subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)<EOL><DEDENT>except subprocess.CalledProcessError:<EOL><INDENT>_set_file_encoding_utf8("<STR_LIT>")<EOL>subprocess.check_output(cmd, shell=True)<EOL><DEDENT>with open(output_json.name, "<STR_LIT:r>") as f:<EOL><INDENT>data = json.loads(f.read())<EOL><DEDENT>for key in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if key in data['<STR_LIT:data>'] and isinstance(data['<STR_LIT:data>'][key], list):<EOL><INDENT>data['<STR_LIT:data>'][key] = sorted(data['<STR_LIT:data>'][key])<EOL><DEDENT><DEDENT><DEDENT>return data<EOL>
run the extractmeta command via the setup.py in the given root_dir.
    the output of extractmeta is json and is stored in a tempfile
    which is then read in and returned as data