Daniel Gonzalez
2012-Apr-23 21:56 UTC
[libvirt-users] Installing the python libvirt bindings in a virtualenv
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
Henrik Ahlgren
2012-Apr-24 05:35 UTC
[libvirt-users] Installing the python libvirt bindings in a virtualenv
On Mon, Apr 23, 2012 at 11:56:56PM +0200, Daniel Gonzalez wrote:> 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.In Debian and derivates, I believe the package you want to install is called python2.7-dev. Also, I would use the latest libvirt release (0.9.11) instead of 0.9.9.