virt-backup icon indicating copy to clipboard operation
virt-backup copied to clipboard

Failed to install; Failed to build libvirt-python

Open alphaDev23 opened this issue 4 years ago • 6 comments

Received the following when running 'sudo -H pip3 install virt-backup'

Building wheels for collected packages: virt-backup, libvirt-python Running setup.py bdist_wheel for virt-backup ... done Stored in directory: /root/.cache/pip/wheels/24/2e/0d/b3103fed109ad402f0ca5b915326ab4e4681e2769e55deb47f Running setup.py bdist_wheel for libvirt-python ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-dd28ztdb/libvirt-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" bdist_wheel -d /tmp/tmpjycy7m9cpip-wheel- --python-tag cp35: running bdist_wheel running build Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 374, in "Programming Language :: Python :: 3.8", File "/usr/lib/python3.5/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 179, in run self.run_command('build') File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 151, in run check_minimum_libvirt_version() File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 44, in check_minimum_libvirt_version spawn([get_pkgcfg(), File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 40, in get_pkgcfg raise Exception("pkg-config binary is required to compile libvirt-python") Exception: pkg-config binary is required to compile libvirt-python


Failed building wheel for libvirt-python Running setup.py clean for libvirt-python Successfully built virt-backup Failed to build libvirt-python Installing collected packages: argparse, python-dateutil, arrow, defusedxml, libvirt-python, packaging, virt-backup Found existing installation: python-dateutil 2.4.2 Not uninstalling python-dateutil at /usr/lib/python3/dist-packages, outside environment /usr Running setup.py install for libvirt-python ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-dd28ztdb/libvirt-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-th2xgfjk-record/install-record.txt --single-version-externally-managed --compile: running install running build Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 374, in "Programming Language :: Python :: 3.8", File "/usr/lib/python3.5/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run self.run_command('build') File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 151, in run check_minimum_libvirt_version() File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 44, in check_minimum_libvirt_version spawn([get_pkgcfg(), File "/tmp/pip-build-dd28ztdb/libvirt-python/setup.py", line 40, in get_pkgcfg raise Exception("pkg-config binary is required to compile libvirt-python") Exception: pkg-config binary is required to compile libvirt-python

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-dd28ztdb/libvirt-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-th2xgfjk-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dd28ztdb/libvirt-python/

alphaDev23 avatar Oct 07 '20 02:10 alphaDev23

You need to install pkg-config in your distribution. For Debian based systems: apt install pkg-config.

aruhier avatar Oct 07 '20 09:10 aruhier

You need to install pkg-config in your distribution. For Debian based systems: apt install pkg-config.

I still get the error.

tardigrde avatar Feb 24 '21 12:02 tardigrde

@tardigrde : Can you try to do apt-get build-dep python3-pkgconfig please?

aruhier avatar Feb 24 '21 13:02 aruhier

Although, I don't get it, pkg-config is the only dependency for https://packages.debian.org/fr/source/buster/python-pkgconfig

And it's the only thing I had to install on debian.

Edit: @tardigrde: can you check that pkg-config is in your PATH? You can also try to manually set the PKG_CONFIG env variable, but it shouldn't be needed: https://github.com/libvirt/libvirt-python/blob/master/setup.py#L33

aruhier avatar Feb 24 '21 13:02 aruhier

@tardigrde : Can you try to do apt-get build-dep python3-pkgconfig please?

So I'm using a conda environment, a totally clear one, python==3.7. I installed the packages you suggested, but with the conda env's pip, I still get the same error.

How do I check the pkg-config?

tardigrde avatar Feb 24 '21 15:02 tardigrde

Sorry, I don't know, I don't use conda. You probably need to install pkg-config (the binary, not the python library) inside your conda environment, as it's a dependency for libvirt-python. Sadly I cannot do more support than that…

aruhier avatar Feb 24 '21 15:02 aruhier