PC (Windows 10)에 연결되어있는 다른 Xbee에 Xbee 형식의 데이터를 보내고 싶습니다. 하지만 필요한 xbee 라이브러리를 가져올 수 없습니다. 나는의 코드를했다 ImportError : 'XBee'라는 이름을 가져올 수 없습니다.
import serial
from xbee import XBee
serial_port = serial.Serial('COM4', 9600)
xbee2 = XBee(serial_port)
while True:
try:
reponse = xbee2.wait_read_frame()
print (reponse)
except KeyboardInterrupt:
break
serial_port.close()
:
Traceback (most recent call last):
File "C:\Users\mis\Desktop\xbee.py", line 2, in <module>
from xbee import XBee
File "C:\Users\mis\Desktop\xbee.py", line 2, in <module>
from xbee import XBee
ImportError: cannot import name 'XBee'
수있는 누군가의 도움 : 여기 https://python-xbee.readthedocs.io/en/latest/
는 오류가 여기에 pip install xbee
내 코드입니다 : 내가 가진 librairy 설치 나, 미리 감사드립니다.
저는 Windows 10 Power Shell에서'pip install XBee'를했는데 효과가있었습니다. 그것이 당신이 한 일이 아니라면 그것을 시도 할 수 있습니다. –