pythonnet
.NET and Mono integration for Python
Decision gist · record as of 2026-08-14
Yes, if you need to integrate Python with .NET or Mono. The package is production-stable, actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. The main constraint is the requirement for a .NET runtime on the target system; verify that your deployment environment has the necessary .NET/Mono installation before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- .NET Framework, .NET Core, or Mono must be installed on the system; on Linux/macOS, Mono is used by default unless PYTHONNET_RUNTIME=coreclr is set.
- Low friction install with a single runtime dependency (clr_loader).
- Active maintenance with recent commits and production-stable status.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both commercial and open-source projects.
last release 2026-05-23 (83 days) · last repo commit 2026-08-14 · 5,508 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,618,934 downloads/mo, #2,556 on PyPI
Alternatives
Verify before relying
pip install pythonnet
import clr
clr.AddReference("System.Windows.Forms")- Performance overhead of CLR interop calls compared to native .NET or pure Python
- Completeness of type mapping between Python and CLR for complex generic types
- Thread-safety guarantees beyond the documented GIL usage pattern
What it is and what it does
pythonnet bridges Python and the .NET Common Language Runtime, enabling two-way integration: Python code can import and call .NET namespaces and assemblies as if they were Python packages, while .NET applications can initialize a Python engine and invoke Python modules dynamically. It treats CLR namespaces as Python packages and provides a clr module for loading assemblies and managing the runtime.
The package supports multiple runtimes—Mono on Linux/macOS and .NET Framework on Windows by default, with .NET Core available via environment variable or explicit load call. For embedding Python in .NET, it requires setting the Python DLL path and managing thread access through a GIL context manager. It is actively maintained, supports modern Python versions (3.10–3.14), and has no known security vulnerabilities.
Use it for
- Call Windows Forms or WPF UI libraries from Python scripts to build GUI applications with .NET components.
- Embed Python in a C# application to allow dynamic scripting or plugin functionality without rewriting core logic.
- Access .NET data structures and business logic from Python data science or automation workflows.
- Prototype or test .NET libraries interactively from Python before integrating them into larger .NET projects.
- Migrate legacy Python code to .NET incrementally by calling existing Python modules from new C# code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to integrate Python with .NET or Mono.
The package is production-stable, actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. The main constraint is the requirement for a .NET runtime on the target system; verify that your deployment environment has the necessary .NET/Mono installation before committing.
Install
pythonnet on PyPI
Before you install
Low friction install with a single runtime dependency (clr_loader). Active maintenance with recent commits and production-stable status. Supports Python 3.10 through 3.14.
.NET Framework, .NET Core, or Mono must be installed on the system; on Linux/macOS, Mono is used by default unless PYTHONNET_RUNTIME=coreclr is set.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both commercial and open-source projects.
Quickstart
pip install pythonnet
import clr
clr.AddReference("System.Windows.Forms")
Verify before relying
- Performance overhead of CLR interop calls compared to native .NET or pure Python
- Completeness of type mapping between Python and CLR for complex generic types
- Thread-safety guarantees beyond the documented GIL usage pattern
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <3.15,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageclr_loader |
| Maintenance | Actively maintained 83 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,618,934 / month, #2,556 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: C#Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: pythonnet-3.1.0-cp310.cp311.cp312.cp313.cp314-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “.NET integration from Python”
- pythonnetpythonnet enables Python code to call .NET and Mono libraries…
- dotnetcore2Bundles the .NET Core 3.1 runtime as a Python wheel, enabling Python…
- clr_loaderLoads and provides a generic interface to call functions on CLR…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also clr_loader · dotnetcore2 · powerfx · dnfile · cffi · dncil · py4j · pyobjc · pyobjc-core · PyQtWebEngine