ImportError: No module named 'digi'

Hi,

I have a ccimx6ulsbc with yocto project in which i have installed the python-xbee library at build. I have updated the firmware and now when I try to run a python script in which I use the xbee it doesnt work. The script is:

from digi.xbee.devices import ZigBeeDevice, RemoteZigBeeDevice, XBee64BitAddress
xbee = ZigBeeDevice(“/dev/ttyXBee”, 9600)
xbee.open()
remote = RemoteZigBeeDevice(xbee, XBee64BitAddress.from_hex_string(mac))
xbee.send_expl_data(remote, message, se, de, clid, prfid)
xbee.close()

and the error it shows is:

ImportError: No module named ‘digi’

For including the library at build I have added to the conf/local.conf the following lines:
IMAGE_INSTALL_append = " python3"
IMAGE_INSTALL_append = " python3-requests"
IMAGE_INSTALL_append = " python3-pip"

any idea how to fix it?

Hi pablovi96,

If you have pip installed on the target, you can install the XBee Python Library with the following command:

python3 -m pip install digi-xbee

Best regards.

1 Like