![]() |
VOOZH | about |
dotnet add package Python.Included --version 3.13.4
NuGet\Install-Package Python.Included -Version 3.13.4
<PackageReference Include="Python.Included" Version="3.13.4" />
<PackageVersion Include="Python.Included" Version="3.13.4" />Directory.Packages.props
<PackageReference Include="Python.Included" />Project file
paket add Python.Included --version 3.13.4
#r "nuget: Python.Included, 3.13.4"
#:package Python.Included@3.13.4
#addin nuget:?package=Python.Included&version=3.13.4Install as a Cake Addin
#tool nuget:?package=Python.Included&version=3.13.4Install as a Cake Tool
Python.Included is an automatic deployment mechanism for .NET packages which depend on the embedded Python distribution. This allows libraries depending on Python and/or Python packages to be deployed via Nuget without having to worry about any local Python installations.
It packages embedded Python (python-3.13.0-embed-amd64.zip) in its .NET assembly and automatically deploys it in the user's home directory upon first execution. On subsequent runs, it will find Python already deployed and therefor doesn't install it again. It also features a Python package (*.whl) installer which Numpy.NET uses to install the NumPy wheel into the embedded Python installation. Last but not least, for packages that are too big to package into .NET nugets, there is support for installing those with pip.
Note: Python.Included only implements deployment on top of pythonnet_netstandard. If you do not need (or want) the automatic deployment of embedded Python you should use that.
Just reference Python.Included via NuGet, call await Installer.SetupPython(); and you are ready to interop with Python.NET. It is completely irrelevant wether or not you have any local Python installations of any kind.
This short example initializes Python.Included and prints the version of the included Python installation by calling Python's sys.version:
using System;
using System.Threading.Tasks;
using Python.Included;
using Python.Runtime;
namespace NetCoreExample
{
class Program
{
static async Task Main(string[] args)
{
await Installer.SetupPython();
PythonEngine.Initialize();
dynamic sys = Py.Import("sys");
Console.WriteLine("Python version: " + sys.version);
}
}
}
Output (may differ due to updated Python version):
Python version: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
An example of this usage is Numpy.NET which in np.module.gen.cs installs the numpy binary which it includes as embedded resource:
await Installer.SetupPython(force)
await Installer.InstallWheel(typeof(np).Assembly, "numpy-1.16.3-cp37-cp37m-win_amd64.whl")
PythonEngine.Initialize();
var numpy = Py.Import("numpy");
Installer.InstallWheel(Assembly assembly, string resource_name) loads the wheel from the given assembly and installs it into the embedded python installation.
NOTE: Make sure the wheel file is compatible to the version of Python which Python.Included installs (v3.7.3 x64). Also, while it works fine with numpy, not every python package can easily be embedded due to its size. Some might require extra installation routines which are not supported by InstallWheel. In that case, use pip to download and install such packages as described below.
You can install a current version of pip3 and use that to install any python package:
await Installer.SetupPython();
await Installer.TryInstallPip();
await Installer.PipInstallModule("spacy");
PythonEngine.Initialize();
dynamic spacy = Py.Import("spacy");
Console.WriteLine("Spacy version: " + spacy.__version__);
Check out the example project TestPipInstallation to try it out.
The code is stable for Windows. For testing on other platforms help is wanted.
Since Python.Included distributes Python, it is licensed under the Python Software Foundation License (PSF) like Python itself.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Python.Included:
| Package | Downloads |
|---|---|
|
Numpy
C# bindings for NumPy - a fundamental library for scientific computing, machine learning and AI. Does not require a local Python installation! |
|
|
Catalyst.Spacy
Integration for Catalyst to run spaCy models from C#. |
|
|
CuPy.NET
CuPy.NET is a wrapper library for CuPy in Python. |
|
|
Cringules.NGram.Lib
Package Description |
|
|
Rays.Core.Script
Package Description |
Showing the top 6 popular GitHub repositories that depend on Python.Included:
| Repository | Stars |
|---|---|
|
open-rpa/openrpa
Free Open Source Enterprise Grade RPA
|
|
|
killkimno/MORT
MORT λ²μκΈ° νλ‘μ νΈ - Real-time game translator with OCR
|
|
|
curiosity-ai/catalyst
π Catalyst is a C# Natural Language Processing library built for speed. Inspired by spaCy's design, it brings pre-trained models, out-of-the box support for training word and document embeddings, and flexible entity recognition models.
|
|
|
SciSharp/Numpy.NET
C#/F# bindings for NumPy - a fundamental library for scientific computing, machine learning and AI
|
|
|
LegacyGwent/LegacyGwent
ε€ε»ε·«εΈδΉζηΉηηε
ζ΅ηζ¬
|
|
|
nicolasdeory/firelight
A modular game integration for Razer Chroma and other RGB LED devices for League of Legends, Rocket League, Fortnite and many more.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.13.4 | 569 | 5/15/2026 | |
| 3.13.1 | 1,609 | 2/23/2026 | |
| 3.13.0 | 5,838 | 9/1/2025 | |
| 3.11.6 | 58,084 | 11/25/2023 | |
| 3.11.4 | 16,177 | 7/14/2023 | |
| 3.11.3 | 1,160 | 7/6/2023 | |
| 3.11.2 | 48,254 | 3/8/2023 | |
| 3.11.1 | 83,547 | 12/11/2022 | |
| 3.11.0 | 879 | 12/11/2022 | 3.11.0 is deprecated because it has critical bugs. |
| 3.10.0-preview5 | 4,257 | 6/24/2022 | |
| 3.10.0-preview4 | 420 | 6/23/2022 | |
| 3.10.0-preview3 | 458 | 6/23/2022 | |
| 3.10.0-preview2 | 27,773 | 5/31/2022 | |
| 3.10.0-preview1 | 643 | 2/13/2022 | |
| 3.7.3.13 | 132,466 | 9/16/2020 | |
| 3.7.3.12 | 986 | 9/7/2020 | |
| 3.7.3.11 | 801 | 9/4/2020 |