Skip to content
Switch branches/tags
Libvirt Python Binding README

This package provides a python binding to the, and library APIs.

It is written to build against any version of libvirt that
is 0.9.11 or newer.

This code is distributed under the terms of the LGPL version
2 or later.


To build the libvirt python binary requires the GCC and pkg-config
tools, and development headers for the libvirt and python libraries.

Building and installing

The module can be built by following the normal python module
build process

  python build
  sudo python install

or to install as non-root

  python build
  python install --user

If python-nose is installed, you can test the package with

  python test

A makefile shim is provided so that you can do

  make && make check

rather than directly invoking

As of libvirt 1.2.6, it is possible to develop against an uninstalled
libvirt.git checkout, by setting PKG_CONFIG_PATH and LD_LIBRARY_PATH
environment variables to point into that libvirt tree; you can even
automate this by using libvirt's run script:

  /path/to/libvirt/run python build

Patches for this code should be sent to the main libvirt
development mailing list

To send patches, it is strongly recommended to use the
'git send-email' command.

Make sure the mails mention that the patch is for the python
binding. This can be done by setting a config parameter in the
local git checkout

  git config format.subjectprefix "PATCH python"