No module named 'libqtile._ffi_pango' when installing from source
See original GitHub issueThe issue:
Per https://github.com/qtile/qtile/discussions/3101 , I am trying to document all the (far too many) library problems I encounter when trying to run Qtile, because I think they get in the way of getting proper packaging.
I am trying to install Qtile following the Installing from sources section.
I am running Ubuntu 19.10 Eoan, but since I’m having library problems also with newer Ubuntu versions, I might as well start from here.
Following the docs, I install:
sudo apt install python3-cffi
sudo apt install xserver-xorg
sudo apt install python3-xcffib
sudo apt install python3-cairocffi
sudo apt install libpangocairo-1.0-0
sudo pip install --no-cache-dir cairocffi
pip complains that Requirement already satisfied: cairocffi in /usr/lib/python3/dist-packages (0.9.0)
so I uninstall the deb:
sudo apt remove python3-cairocffi
And try again with pip:
sudo pip install --no-cache-dir cairocffi
At this point, I try to run qtile and I get:
nw@red ~$ qtile --version
Traceback (most recent call last):
File "/home/nw/qtile/libqtile/pangocffi.py", line 51, in <module>
from libqtile._ffi_pango import ffi
ModuleNotFoundError: No module named 'libqtile._ffi_pango'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/qtile", line 5, in <module>
from libqtile.scripts.main import main
File "/home/nw/qtile/libqtile/scripts/main.py", line 6, in <module>
from libqtile.scripts import check, cmd_obj, migrate, run_cmd, shell, start, top
File "/home/nw/qtile/libqtile/scripts/check.py", line 29, in <module>
from libqtile import confreader
File "/home/nw/qtile/libqtile/confreader.py", line 31, in <module>
from libqtile.backend.x11 import core
File "/home/nw/qtile/libqtile/backend/x11/core.py", line 36, in <module>
from libqtile import config, hook, utils
File "/home/nw/qtile/libqtile/config.py", line 36, in <module>
from libqtile.backend import base
File "/home/nw/qtile/libqtile/backend/base.py", line 11, in <module>
from libqtile import drawer, pangocffi, utils
File "/home/nw/qtile/libqtile/drawer.py", line 35, in <module>
from libqtile import pangocffi, utils
File "/home/nw/qtile/libqtile/pangocffi.py", line 53, in <module>
raise ImportError("No module named libqtile._ffi_pango, be sure to run `./scripts/ffibuild`")
ImportError: No module named libqtile._ffi_pango, be sure to run `./scripts/ffibuild`
Ok, let’s run the script:
w@red ~/qtile master$ ./scripts/ffibuild
building pango
building xcursors
building pulseaudio volume control
libqtile/widget/_pulse_audio.c:541:14: fatal error: pulse/sample.h: No such file or directory
541 | #include "pulse/sample.h"
| ^~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/usr/lib/python3.8/distutils/unixccompiler.py", line 117, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] +
File "/usr/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.8/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.8/distutils/spawn.py", line 157, in _spawn_posix
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "/usr/lib/python3.8/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python3.8/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./libqtile/widget/pulseaudio_ffi.py", line 421, in <module>
pulseaudio_ffi.compile()
File "/usr/lib/python3/dist-packages/cffi/api.py", line 725, in compile
return recompile(self, module_name, source, tmpdir=tmpdir,
File "/usr/lib/python3/dist-packages/cffi/recompiler.py", line 1535, in recompile
outputfilename = ffiplatform.compile('.', ext,
File "/usr/lib/python3/dist-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/usr/lib/python3/dist-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
building Wayland libinput interface
Traceback (most recent call last):
File "./libqtile/backend/wayland/libinput_ffi_build.py", line 1, in <module>
import wlroots.ffi_build as wlr
ModuleNotFoundError: No module named 'wlroots'
Surprisingly, after this slew of errors, Qtile actually runs.
However, the docs and/or the error reporting could be improved?
I have seen so many library problems that at first I didn’t even notice that I was being asked to run a script, and the script gave all the signs of having failed spectacularly.
Maybe also mention to run pip install dbus-next
, since there is no deb package for that any more?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Firstly, thanks for looking at this.
Yeah, that amount of error messages is pretty ugly. We should try to be a bit neater there (probably one for @m-col as he was looking at minimising wayland requirements at build time)
The script is an important part of the build so needs to be shown in the instructions.
Don’t know about this one. It’s an optional requirement. You don’t need it to run qtile.
Appreciate the frustrations you’re encountering but please do keep pasting them here because if there are parts of the code that need fixing (e.g. better error handling) then we can pick those up.
Thanks! I’ve just started reading through the docs again to identify room for improvement. And the getting started section is definitely one of them. Post any further suggestions to #1679.