How to install dbus-python on macOS?
Asked Answered
H

2

8

In the first step: configure, I got the following error:

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

No package 'dbus-1' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DBUS_CFLAGS
and DBUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Horal answered 31/3, 2017 at 8:31 Comment(0)
K
5

OSX is complaining that it can't find dbus in the system. Try installing it first by doing something like:

brew install dbus

Then, try installing dbus-python by running

pip install dbus-python

In order to run the dbus daemon do brew services start dbus as said in the documentation.

Kaisership answered 30/7, 2018 at 2:37 Comment(2)
Didn't work for me. The error is hereMaterialism
did not work for me either I am on a mac M1 chip mac book pro 13"Latium
H
0

Based on the pastebin Captain Jack Sparrow provided it appears dbus-python's configure script doesn't like Homebrew's install of Python (which it needs to compile the dbus C extension module against), so I don't think it's even getting this far, but to successfully build dbus-python I'm pretty sure you'd need both dbus-glib and the main dbus package.

brew install dbus dbus-glib

There's also this note from Homebrew's Python docs, which may help solve the configure-script problems:

Since the system Python may not know which compiler flags to set when building bindings for software installed by Homebrew, you may need to run:

CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install <package>

So, a full working install might require:

brew install dbus dbus-glib

CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" \
pip install dbus-python
Hoehne answered 7/7 at 11:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.