Closed bernardolansing closed 1 year ago
I haven't tested with Python 3.11, but normally the issue is with Virtual Environments and that D-Bus and the library for the event loop.
The addition steps are documented over in this other ticket:
https://github.com/ukBaz/python-bluezero/issues/307#issuecomment-1426706775
@bernardolansing have you tried installing it with:
sudo apt-get install python3-dbus
I had a similar issue and found this https://stackoverflow.com/a/37927053. Mind the comment on this answer that it should be python3-dbus
for Python 3. Then it worked for me!
Some caution needs to be exercised here about what the base condition of the system is and if a Python virtual environment is being used.
As a side note the apt
command is meant to be pleasant for end users and does not need to be backward compatible like apt-get
. Getting people to use apt
should be the preferred instruction.
If you have an OS installed on the RPi with desktop environment then all the D-Bus components should be installed. If there is not a desktop environment (e.g. RPi lite) then you might have to install python3-dbus
.
apt
will install into dist-packages
while pip
with a venv
will install in to site-packages
. I believe he original question was about use with venv
.
I am trying to use this library inside a Raspberry Zero W. I've sucessfully installed it using
pip install bluezero
, but if I import it, it will cause the following error:Well, so I try to install dbus-python, and now I got a kilometer long error report, listing a lot of missing C libraries:
(list goes on)
If that is important, I am using Python 3.11 inside a virtualenv. Perhaps this issue is not related to bluezero itself, but only with dbus-python, but that repository is not open to issues and I could not find anyone facing such trouble. I would appreciate anyone willing to lend me a hand.