Browse Source

set pythonhome after dll

pull/55/head
Ionite 1 year ago
parent
commit
ad4e08654e
No known key found for this signature in database
  1. 2
      StabilityMatrix.Core/Python/PyRunner.cs

2
StabilityMatrix.Core/Python/PyRunner.cs

@ -72,7 +72,6 @@ public class PyRunner : IPyRunner
Logger.Info("Setting PYTHONHOME and PATH to {HomePath}", PythonDir);
Environment.SetEnvironmentVariable("PYTHONHOME", PythonDir, EnvironmentVariableTarget.Process);
PythonEngine.PythonHome = PythonDir;
// Get existing PATH
var currentEnvPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process);
@ -88,6 +87,7 @@ public class PyRunner : IPyRunner
}
Runtime.PythonDLL = PythonDllPath;
PythonEngine.PythonHome = PythonDir;
PythonEngine.Initialize();
PythonEngine.BeginAllowThreads();

Loading…
Cancel
Save