Reputation:
I want to use XBee python library in raspberry pi. when I run the code, I encounter the following Error
Traceback (most recent call last):
File "XBeeMQTT-V1.py", line 25, in <module>
from digi.xbee.devices import XBeeDevice
File "build/bdist.linux-armv7l/egg/digi/xbee/devices.py", line 22, in <module>
File "build/bdist.linux-armv7l/egg/digi/xbee/serial.py", line 15, in <module>
ImportError: cannot import name Serial
I import serial and xbee-digi in the python code and install both library on raspberry pi (usr/local/lib/python2.7/dist-packages). have any idea where the error stems from?
Upvotes: 1
Views: 998
Reputation:
To solve the problem, follow the steps:
sudo apt-get install python3-pip && sudo apt-get install python3-serial
then go to /usr/local/lib/python3.x/dist-packages and run
sudo pip3 install setuptools
and finally
sudo pip3 install digi-xbee
Upvotes: 1