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?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Timofey Kargin
  • 161
  • 4
  • 15
  • 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. – Gino Mempin Feb 28 '20 at 01:53
  • Also, are there any more logs to what you posted? There maybe some more information on why `pip3 install` failed. – Gino Mempin Feb 28 '20 at 01:57
  • Seems to install fine on Ubuntu18.04, Python3.8.1, dbus-python 1.2.16 – Gino Mempin Feb 28 '20 at 04: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. – Timofey Kargin Feb 29 '20 at 01: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`. – Gino Mempin Feb 29 '20 at 01:43

1 Answers1

6

Try this:

sudo apt-get install libdbus-1-dev libdbus-glib-1-dev
sudo pip3 install autokey
Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
theashwanisingla
  • 412
  • 4
  • 13