No module named dbus

October 31, 2018

A rather annoying error that I recently encountered where dbus wasn't installed correctly. My setup was python 3 on debian stretch and the following commands didn't fix it:

sudo apt install python-dbus
or
sudo apt install python3-dbus

Then I tried

pip install dbus-python

and got a build time error, the output showed:

checking for DBUS... no
configure: error: Package requirements (dbus-1 >= 1.8) were not met:

and the final solution was to run this command, and then try the pip install again:

sudo apt-get install libdbus-1-dev libdbus-glib-1-dev

 

If that doesn't help you, make sure your python environment is the same as the one running the dbus commands! You can also try upgrading your setuptools, which is used in the `pip install` stage.

pip install --upgrade setuptools 

 


Written By Dillon