Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Python_Engine/Compute/Download.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static string DownloadFile(

[Description("Download and install a specified version of python, and return the executable for it.")]
[Input("version", "The version of python to download.")]
[Output("pythonExecutable", "The executable (python.exe) for the python version that was installed")]
[Output("pythonExecutable", "The executable (python.exe) for the python version that was installed.")]
public static string DownloadPythonVersion(this PythonVersion version)
{
string url = version.EmbeddableURL();
Expand Down Expand Up @@ -122,6 +122,7 @@ public static string DownloadPythonVersion(this PythonVersion version)
}
})
{
install.StartInfo.Environment["PYTHONHOME"] = "";
install.Start();
string stderr = install.StandardError.ReadToEnd();
install.WaitForExit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ List<string> packages
FileName = executable,
Arguments = $"-m pip install --no-warn-script-location {packagesString}",
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardError = true
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down Expand Up @@ -111,6 +112,7 @@ string requirements
RedirectStandardError = true,
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down Expand Up @@ -155,6 +157,7 @@ string packageDirectory
RedirectStandardError = true,
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down
1 change: 1 addition & 0 deletions Python_Engine/Compute/Remove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static void RemoveBaseVersion(PythonVersion version = PythonVersion.v3_10
}
})
{
uninstall.StartInfo.Environment["PYTHONHOME"] = "";
uninstall.Start();
string stderr = uninstall.StandardError.ReadToEnd();
uninstall.WaitForExit();
Expand Down
2 changes: 2 additions & 0 deletions Python_Engine/Compute/RequirementsTxt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public static string RequirementsTxt(
RedirectStandardOutput = true
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
StreamWriter sr = new StreamWriter(targetPath);
Expand Down
1 change: 1 addition & 0 deletions Python_Engine/Compute/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static string RunCommandStdout(string command, bool hideWindows = true, s
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
commandMode = "/C";
}
process.StartInfo.Environment["PYTHONHOME"] = "";
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
Expand Down
4 changes: 4 additions & 0 deletions Python_Engine/Compute/VirtualEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public static PythonEnvironment VirtualEnvironment(this PythonVersion version, s
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";

using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand All @@ -114,6 +116,8 @@ public static PythonEnvironment VirtualEnvironment(this PythonVersion version, s
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";

using (Process p = Process.Start(process2.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down