Soenneker.Python.Util
11.0.503
Prefix Reserved
dotnet add package Soenneker.Python.Util --version 11.0.503
NuGet\Install-Package Soenneker.Python.Util -Version 11.0.503
<PackageReference Include="Soenneker.Python.Util" Version="11.0.503" />
<PackageVersion Include="Soenneker.Python.Util" Version="11.0.503" />
<PackageReference Include="Soenneker.Python.Util" />
paket add Soenneker.Python.Util --version 11.0.503
#r "nuget: Soenneker.Python.Util, 11.0.503"
#:package Soenneker.Python.Util@11.0.503
#addin nuget:?package=Soenneker.Python.Util&version=11.0.503
#tool nuget:?package=Soenneker.Python.Util&version=11.0.503
Soenneker.Python.Util
Locates a specific Python major/minor version and can install it through the host's package manager.
Installation
dotnet add package Soenneker.Python.Util
Registration
using Soenneker.Python.Util.Registrars;
services.AddPythonUtilAsSingleton();
Locate an interpreter
using Soenneker.Python.Util.Abstract;
IPythonUtil python = serviceProvider.GetRequiredService<IPythonUtil>();
string path = await python.EnsureInstalled(
minVersion: "3.12",
installIfMissing: false,
cancellationToken: cancellationToken);
Despite the parameter's compatibility name, the version is matched by exact major/minor: 3.12 accepts any Python 3.12 patch release, not Python 3.13.
The lookup checks common launchers, the GitHub/Azure hosted-tool cache on Windows, and the Windows Python registry. It returns the interpreter path reported by the matching installation.
Resolve a command directly
string defaultPython = await python.GetPythonPath("python", cancellationToken);
string windowsPython = await python.GetPythonPath("py -3", cancellationToken);
string explicitPython = await python.GetPythonPath(
@"C:\Python312\python.exe",
cancellationToken);
GetPythonPath runs the supplied interpreter or launcher and returns sys.executable; it does not enforce a version.
Install when missing
Set installIfMissing: true, or call TryInstall(new Version(3, 12), cancellationToken), to invoke the platform package manager:
- Windows:
winget, falling back to Chocolatey. - macOS: Homebrew.
- Linux:
apt-getthroughsudo.
Installation changes the machine and may require elevated permissions, accepted package sources, and network access. Prefer installIfMissing: false in application code unless machine provisioning is explicitly intended. Cancellation stops the active process call but does not roll back package-manager changes already made.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Asyncs.Semaphores (>= 11.0.38)
- Soenneker.Utils.Directory (>= 11.0.980)
- Soenneker.Utils.File.Download (>= 11.0.1854)
- Soenneker.Utils.Json (>= 11.0.2789)
- Soenneker.Utils.Process (>= 11.0.1615)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Python.Util:
| Package | Downloads |
|---|---|
|
Soenneker.DocTr.Util
A cross-platform docTR OCR utility for .NET using Python. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.503 | 0 | 11/14/2026 |
| 11.0.502 | 78 | 11/12/2026 |
| 11.0.501 | 77 | 11/11/2026 |
| 11.0.499 | 49 | 11/11/2026 |
| 11.0.498 | 64 | 11/11/2026 |
| 11.0.496 | 66 | 11/11/2026 |
| 11.0.495 | 54 | 11/11/2026 |
| 11.0.494 | 58 | 11/11/2026 |
| 11.0.493 | 57 | 11/11/2026 |
| 11.0.492 | 53 | 11/11/2026 |
| 11.0.491 | 71 | 11/11/2026 |
| 11.0.490 | 209 | 11/3/2026 |
| 11.0.489 | 99 | 11/3/2026 |
| 11.0.488 | 97 | 11/3/2026 |
| 11.0.487 | 93 | 11/3/2026 |
| 11.0.486 | 96 | 11/3/2026 |
| 11.0.484 | 104 | 11/3/2026 |
| 11.0.483 | 96 | 11/3/2026 |
| 11.0.482 | 98 | 11/3/2026 |
| 11.0.481 | 92 | 11/3/2026 |
Update dependency Soenneker.Utils.Json to 11.0.2789 (#772)