Hi,
So I’m trying to make some DBUS call in one of my containers. I’m building the image using the balenalib alpine image with python, as seen from the below snippet:
FROM balenalib/%%BALENA_MACHINE_NAME%%-alpine-python:run
There aren’t any issues calling Python to run Python scripts, until I try to run a script using dbus via import dbus
in the Python script. I’m following the official balena docs for accessing dbus via python, found here: Network Setup on balenaOS - Balena Documentation. When I try to run an example, the build goes fine but I get the following error when the image is downloaded to the device and Balena tries to run the script:
Traceback (most recent call last):
myproject-initialize File "/myproject/networkscript.py", line 2, in <module>
myporject-initialize import dbus
myproject-initialize ModuleNotFoundError: No module named 'dbus'
As can be seen, the image doesn’t see the dbus module. I have tried multiple workarounds for this, including:
- Using install_packages to install python-dbus
- Using the ubuntu image with Python
- Manually apt-get installing python-dbus within the Ubuntu image
For those package management workarounds, it reports that there’s no package named python-dbus
, while using the ubuntu image which should already have the Python dbus module, it reports the same error.
As far as I can see I’m directly following the balena documentation, what’s going on here?