libvirt-python
The libvirt virtualization API python binding
Decision gist · record as of 2026-08-14
Yes, if you need to manage libvirt-controlled VMs or containers from Python and your system already has libvirt installed. The high install friction (compiled dependency) is a real barrier—verify that your platform has prebuilt wheels or that you can satisfy the build requirements before attempting installation. For systems without libvirt or build tools, the installation will fail.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires GCC, pkg-config, and libvirt development headers (libvirt-devel or libvirt-dev) installed on your system before pip install will succeed.
- High install friction: requires GCC, pkg-config, and libvirt development headers to compile from source.
- The package is actively maintained (released 11 days ago) and classified as Production/Stable, but the compiled dependency barrier means installation success depends on your system's build toolchain and libvirt libraries being present.
License · maintenance · safety
LGPL-v2.0-or-later (copyleft) — Licensed under LGPL-v2.0-or-later (copyleft). You may use and modify this package freely, but any derivative work must also be distributed under LGPL or a compatible license, and source code must be made available to recipients.
last release 2026-08-03 (11 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 323,552 downloads/mo, #7,604 on PyPI
Alternatives
Verify before relying
# Install (requires libvirt dev headers and build tools)
pip install libvirt-python
# Basic usage
import libvirt
conn = libvirt.open('qemu:///system')
doms = conn.listAllDomains()
conn.close()- Whether prebuilt wheels are available for common platforms to avoid compilation
- Specific libvirt version compatibility beyond the stated minimum of 0.9.11
- Performance characteristics or scalability limits for large-scale VM management
What it is and what it does
libvirt-python is a Python module that wraps the libvirt C library, exposing its virtualization management API to Python applications. It allows you to programmatically control virtual machines, containers, and other virtualization resources managed by libvirt on Linux and other operating systems. The bindings cover the main libvirt API as well as QEMU and LXC-specific extensions.
The package requires a working libvirt installation and development headers on your system, plus standard build tools (GCC, pkg-config) to compile. It supports Python 3.6 and later, is actively maintained, and carries no known security vulnerabilities. The LGPL-v2.0-or-later license permits commercial use but requires source disclosure for modifications.
Use it for
- Automate VM lifecycle management (create, start, stop, destroy) on KVM/QEMU hypervisors from Python scripts
- Monitor and query running virtual machines and containers (LXC) to retrieve resource usage and status
- Build cloud orchestration or infrastructure-as-code tools that need to control libvirt-managed virtualization
- Integrate VM provisioning into Python-based deployment or testing frameworks
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to manage libvirt-controlled VMs or containers from Python and your system already has libvirt installed.
The high install friction (compiled dependency) is a real barrier—verify that your platform has prebuilt wheels or that you can satisfy the build requirements before attempting installation. For systems without libvirt or build tools, the installation will fail.
Install
libvirt-python on PyPI
Before you install
High install friction: requires GCC, pkg-config, and libvirt development headers to compile from source. The package is actively maintained (released 11 days ago) and classified as Production/Stable, but the compiled dependency barrier means installation success depends on your system's build toolchain and libvirt libraries being present.
Requires GCC, pkg-config, and libvirt development headers (libvirt-devel or libvirt-dev) installed on your system before pip install will succeed.
License in practice
Licensed under LGPL-v2.0-or-later (copyleft). You may use and modify this package freely, but any derivative work must also be distributed under LGPL or a compatible license, and source code must be made available to recipients.
Quickstart
# Install (requires libvirt dev headers and build tools)
pip install libvirt-python
# Basic usage
import libvirt
conn = libvirt.open('qemu:///system')
doms = conn.listAllDomains()
conn.close()
Verify before relying
- Whether prebuilt wheels are available for common platforms to avoid compilation
- Specific libvirt version compatibility beyond the stated minimum of 0.9.11
- Performance characteristics or scalability limits for large-scale VM management
Package facts
| License | LGPL-v2.0-or-later copyleft |
| Python support | Supports the current Python release >=3.6 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Actively maintained 11 days since the last release |
| First released | |
| Downloads | 323,552 / month, #7,604 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 :: DevelopersProgramming Language :: Python :: 3 :: Only |
Evidence: libvirt_python-12.6.0.tar.gz
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 › “libvirt python bindings”
- libvirt-pythonProvides Python bindings to the libvirt virtualization API, allowing…
- kclikcli is a command-line provisioning and management tool for virtual…
- molecule-vagrantMolecule Vagrant Plugin enables Vagrant-based provisioning and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also kcli · pyobjc-framework-Virtualization · azure-mgmt-desktopvirtualization · qemu.qmp · cot · python-rrmngmnt · docker-py · dissect.hypervisor · systemd-python · rpm