【发布时间】:2021-05-13 15:39:12
【问题描述】:
我正在尝试使用 can-python 库发送 can 消息 低于错误 AttributeError: 模块 'can' 没有属性 'interface'
can-python 版本:3.3.4 蟒蛇版本:3
代码
import can
def send():
bus = can.interface.Bus()
msg = can.Message(arbitration_id=0x68005,data=[0x10,0x11,0x12],is_extended_id=True)
try:
bus.send(msg)
print("Message sent on {}".format(bus.channel_info))
except can.CanError:
print("Message NOT sent")'
if __name__ == '__main__':
send()
我关注了这个 AttributeError when using python-can (module 'can' has no attribute 'interface')
对我没用
【问题讨论】:
-
@HantsanialaEléo,帖子中提到的答案对我不起作用
标签: python-3.x can-bus