4

I want to install HP driver (hplip) on my Ubuntu.

It tries to install d-bus python package, but fails and says to install it manually.

Installation with "apt" works fine, but maybe not for my main Python version and that's why hplip failed:

sudo apt install -y dbus

... works well

timofei@timofei:~/Downloads$ python
Python 3.8.0 (default, Oct 28 2019, 16:14:01) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 77, in <module>
    import dbus.types as types
  File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in <module>
    from _dbus_bindings import (
ModuleNotFoundError: No module named '_dbus_bindings'

So I tried this:

pip3 install dbus-python

But didn't succed:

    subprocess.CalledProcessError: Command '['/tmp/pip-install-d0ae2vew/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/usr/bin/python3', '--prefix=/tmp/pip-install-d0ae2vew/dbus-python/build/temp.linux-x86_64-3.8/prefix']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d0ae2vew/dbus-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d0ae2vew/dbus-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivj6cz_0/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/timofei/.local/include/python3.8/dbus-python Check the logs for full command output.

I have tried

pip3 install --upgrade setuptools

, it works fine.

What can I do?

5
  • What is your specific Ubuntu version? Have you tried with a lower Python version (Python3.7)? Because you are using 3.8, which is quite "new", and the dbus-python maybe not yet updated to support 3.8. Commented Feb 28, 2020 at 1:53
  • Also, are there any more logs to what you posted? There maybe some more information on why pip3 install failed. Commented Feb 28, 2020 at 1:57
  • Seems to install fine on Ubuntu18.04, Python3.8.1, dbus-python 1.2.16 Commented Feb 28, 2020 at 4:09
  • Ubuntu 18.04, python3.8. Not sure how to change python version that is used by driver installer. pip3 gives me a lot of logs (few pages), not sure how to post them all here, but I think I have posted most useful information. Commented Feb 29, 2020 at 1:18
  • Unfortunately that last line of errors you posted isn't enough. Try scrolling through the logs, and look for "configure: error" or setup.py errors or plain Error or Traceback. Commented Feb 29, 2020 at 1:43

1 Answer 1

7

Try this:

sudo apt-get install libdbus-1-dev libdbus-glib-1-dev
sudo pip3 install autokey
1
  • 7
    I think you mean libdbus-glib-1-dev.
    – Glen K
    Commented Oct 21, 2021 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.