diff --git a/WebServer/Controllers/PythonInterop.cs b/WebServer/Controllers/PythonInterop.cs index 87ea3ea4..ea723ab5 100644 --- a/WebServer/Controllers/PythonInterop.cs +++ b/WebServer/Controllers/PythonInterop.cs @@ -16,6 +16,9 @@ namespace PythonInterop { // Initiilize python PythonEngine.Initialize(); + + // Needed because C# calls the python from each connections worker thread + PythonEngine.BeginAllowThreads(); } // This is thread blocking, runs on the main thread, and takes multiple minutes so probabaly need to run on a background thread at some point