Soenneker.Python.Util
11.0.517
Prefix Reserved
dotnet add package Soenneker.Python.Util --version 11.0.517
NuGet\Install-Package Soenneker.Python.Util -Version 11.0.517
<PackageReference Include="Soenneker.Python.Util" Version="11.0.517" />
<PackageVersion Include="Soenneker.Python.Util" Version="11.0.517" />
<PackageReference Include="Soenneker.Python.Util" />
paket add Soenneker.Python.Util --version 11.0.517
#r "nuget: Soenneker.Python.Util, 11.0.517"
#:package Soenneker.Python.Util@11.0.517
#addin nuget:?package=Soenneker.Python.Util&version=11.0.517
#tool nuget:?package=Soenneker.Python.Util&version=11.0.517
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.40)
- Soenneker.Utils.Directory (>= 11.0.986)
- Soenneker.Utils.File.Download (>= 11.0.1869)
- Soenneker.Utils.Json (>= 11.0.2797)
- Soenneker.Utils.Process (>= 11.0.1623)
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.517 | 127 | 11/22/2026 |
| 11.0.516 | 125 | 11/19/2026 |
| 11.0.514 | 103 | 11/19/2026 |
| 11.0.513 | 105 | 11/19/2026 |
| 11.0.512 | 108 | 11/18/2026 |
| 11.0.510 | 99 | 11/18/2026 |
| 11.0.509 | 94 | 11/18/2026 |
| 11.0.508 | 119 | 11/18/2026 |
| 11.0.507 | 149 | 11/16/2026 |
| 11.0.506 | 97 | 11/15/2026 |
| 11.0.505 | 124 | 11/15/2026 |
| 11.0.504 | 114 | 11/15/2026 |
| 11.0.503 | 126 | 11/14/2026 |
| 11.0.502 | 142 | 11/12/2026 |
| 11.0.501 | 126 | 11/11/2026 |
| 11.0.499 | 94 | 11/11/2026 |
| 11.0.498 | 113 | 11/11/2026 |
| 11.0.496 | 114 | 11/11/2026 |
| 11.0.495 | 101 | 11/11/2026 |
| 11.0.494 | 104 | 11/11/2026 |
Update dependency Soenneker.Utils.File.Download to 11.0.1869 (#778)