I'm not sure this will apply to your 19.04 as I'm now debugging this on ubuntu 16.04.
First, it's useful to run hp-check
, which tests many things about your installation of hplip. It was telling me I'm missing 2 python libraries:
error: python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - MISSING 'python3-notify2 needs to be installed'
...
error: python3-pyqt4-dbus PyQt 4 DBus - DBus Support for PyQt4 OPTIONAL 4.0 4.11.4 MISSING 'python3-pyqt4-dbus needs to be installed'
OK, sudo apt install python3-notify2
was easy enough, but there was no python3-pyqt4-dbus
in 16.04. However further down it says the same thing but suggest a different package name:
Missing Optional Dependencies
-----------------------------
error: 'python3-notify2' package is missing/incompatible
error: 'python3-dbus.mainloop.qt' package is missing/incompatible
and sudo apt install python3-dbus.mainloop.qt
worked for me (fixing both messages)!
We can also find it in the code:
$ ag --before=5 'Unable to load DBus libraries.' /usr/share/hplip/
/usr/share/hplip/ui4/devmgr5.py
48-try:
49- import dbus
50- from dbus.mainloop.qt import DBusQtMainLoop
51- from dbus import lowlevel
52-except ImportError:
53: log.error("Unable to load DBus libraries. Please check your installation and try again.")
so your error message must be coming from one of those import lines.
By opening python3
interpreter and pasting these lines one by one (without leading whitespace!), I confirmed which one was failing:
$ python3
Python 3.5.2 (default, Apr 16 2020, 17:47:17)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
>>> from dbus.mainloop.qt import DBusQtMainLoop
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'dbus.mainloop.qt'
>>> from dbus import lowlevel
>>> exit()
I then did apt search dbus.mainloop.qt
and arrived at same conclusion that I need sudo apt install python3-dbus.mainloop.qt
. (I actually did this before noticing the latter hint from hp-check :-)
Try this analysis on your ubuntu.
Now hp-toolbox
launches successfully.
hp-toolbox
? Also see this answer to reduce number of warnings. Are you using hplip installed from deb-package? – N0rbert Jan 12 '20 at 10:54