Bon, cela fait deux ans que cette question a été posée, mais cela ne m'a pas empêché de perdre mon temps sur le même problème.
pip3 install dbus-python
m'a juste fait rencontrer quelques problèmes comme :
...
checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
checking consistency of all components of python development environment... no
configure: error: in `/tmp/pip-build-407jqhld/dbus-python/build/temp.linux-x86_64-3.7':
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LIBS environment variable.
Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-407jqhld/dbus-python/setup.py", line 111, in <module>
tests_require=['tap.py'],
File "/home/schwaigeradm/.local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/schwaigeradm/.local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-407jqhld/dbus-python/setup.py", line 64, in run
cwd=builddir)
File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/tmp/pip-build-407jqhld/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/usr/bin/python3', '--prefix=/tmp/pip-build-407jqhld/dbus-python/build/temp.linux-x86_64-3.7/prefix']' returned non-zero exit status 1.
----------------------------------------
Failed building wheel for dbus-python
Running setup.py clean for dbus-python
Failed to build dbus-python
L'installation ou la réinstallation d'un de mes logiciels actuels n'a pas aidé. Mais j'ai réalisé que c'est un problème lié à python3.7 :
Comme dans python2.7 il était possible d'ajouter import dbus, mais dans pyhon3.7 cela a échoué avec la même erreur :
Traceback (most recent call last):
import dbus
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'
La solution est assez simple :
sudo apt-get install python3.7-dev
pip3 install dbus-python