Java呼び出しpythonのCannot import site module and its dependencies:No module named site問題の解決
1505 ワード
Properties props = new Properties();
props.put("python.home", "path to the Lib folder");
props.put("python.console.encoding", "UTF-8");
props.put("python.security.respectJavaAccessibility", "false");
props.put("python.import.site", "false");
Properties preprops = System.getProperties();
PythonInterpreter.initialize(preprops, props, new String[0]);
—————————— ————————————
PythonInterpreter interpreter = new PythonInterpreter();
interpreter.execfile("C:/Python27/asdd.py");
python Cannot import site module and its dependencies: No module named site