Make work for both debug and live
This commit is contained in:
@@ -4,18 +4,15 @@ namespace PythonInterop {
|
||||
|
||||
public class AIModule {
|
||||
|
||||
public AIModule(string PythonPath = "/usr/local/lib/libpython3.11.so") {
|
||||
public AIModule(string PythonPathBase = "/usr/local/", string PythonVersion = "python3.11") {
|
||||
// Use the user provided python runner
|
||||
Runtime.PythonDLL = PythonPath;
|
||||
|
||||
string baseDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string pythonFiles = Path.Combine(baseDir, "AIPython");
|
||||
Runtime.PythonDLL = PythonPathBase + $"lib/lib{PythonVersion}.so";
|
||||
|
||||
// Use our local environment for the python libraries
|
||||
PythonEngine.PythonHome = "/usr/local";
|
||||
PythonEngine.PythonHome = PythonPathBase;
|
||||
|
||||
// Include all the paths for python packages most importantly our venv
|
||||
PythonEngine.PythonPath = $"/usr/local/lib/python3.11:/usr/local/lib/python3.11/lib-dynload:/usr/local/lib/python3.11/site-packages:{pythonFiles}";
|
||||
PythonEngine.PythonPath = $"{PythonPathBase}lib/{PythonVersion}:{PythonPathBase}lib/{PythonVersion}/lib-dynload:{PythonPathBase}lib/{PythonVersion}/site-packages:{Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AIPython")}";
|
||||
|
||||
// Initiilize python
|
||||
PythonEngine.Initialize();
|
||||
|
||||
Reference in New Issue
Block a user