From ad4e08654e529caba982ebbeef0ffba69d15075c Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 17 Jul 2023 17:12:23 -0400 Subject: [PATCH] set pythonhome after dll --- StabilityMatrix.Core/Python/PyRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StabilityMatrix.Core/Python/PyRunner.cs b/StabilityMatrix.Core/Python/PyRunner.cs index 1ddd18f8..4233b667 100644 --- a/StabilityMatrix.Core/Python/PyRunner.cs +++ b/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();