Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install; Failed to build libvirt-python #41

Open
alphaDev23 opened this issue Oct 7, 2020 · 6 comments
Open

Failed to install; Failed to build libvirt-python #41

alphaDev23 opened this issue Oct 7, 2020 · 6 comments

Comments

@alphaDev23
Copy link

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/

@aruhier
Copy link
Owner

aruhier commented Oct 7, 2020

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

@tardigrde
Copy link

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

I still get the error.

@aruhier
Copy link
Owner

aruhier commented Feb 24, 2021

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

@aruhier
Copy link
Owner

aruhier commented Feb 24, 2021

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

@tardigrde
Copy link

@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?

@aruhier
Copy link
Owner

aruhier commented Feb 24, 2021

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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants