[libvirt-users] Installing the python libvirt bindings in a virtualenv

Daniel Gonzalez gonvaled at gonvaled.com
Mon Apr 23 21:56:56 UTC 2012


Hi,

I have a virtualenv which I am using for production (I need python 2.7
and certain libraries which can not be easily installed on the host
environment).
Now I am trying to install also libvirt, but I have not succeeded yet.
The problem that I have now looks quite difficult to solve. This is
the script I am using to install libvirt (bash script):

install_libvirt_ ( ) {
    local myvirtualenv="$1"
    local libvirt_tag=v0.9.9
    cd $TMP_DIR
    git clone git://libvirt.org/libvirt.git
    cd libvirt
    git checkout $libvirt_tag
    mkdir -p $VIRTUALENVS_DIR/$myvirtualenv/usr
    sudo apt-get install autopoint
    # configure: error: You must install the GnuTLS library in order
to compile and run libvirt
    sudo apt-get install -y gnutls-bin gnutls-dev
    # configure: error: You must install
device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
    sudo apt-get install -y libdevmapper-dev libdevmapper
    # configure: error: You must install python-devel to build Python bindings
    sudo apt-get install -y python-all-dev
    ./autogen.sh --prefix=$VIRTUALENVS_DIR/$myvirtualenv/usr
--enable-compile-warnings=error
    make
    make install
}

But this is failing with error message:

checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory...
${exec_prefix}/lib/python2.7/site-packages
configure: error: You must install python-devel to build Python bindings

python-devel does not exist. I have used python-all-dev, but it has
not solved the problem.

Has somebody succeeded in installing libvirt-python inside a virtualenv?

Thanks,
Daniel Gonzalez




More information about the libvirt-users mailing list