Home/Support/Support Forum/ImportError: No module named 'digi'

ImportError: No module named 'digi'

0 votes

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)
remote = RemoteZigBeeDevice(xbee, XBee64BitAddress.from_hex_string(mac))
xbee.send_expl_data(remote, message, se, de, clid, prfid)

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?
asked Apr 21, 2020 in XBee3 ZigBee by pablovi96 New to the Community (25 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Best answer
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.
answered Apr 21, 2020 by rmoral New to the Community (45 points)
selected Apr 22, 2020 by pablovi96