我在运行以下代码时出错:
import can #importing CAN module
import time
bus1 = can.interface.Bus(bustype='vector', channel=0, bitrate=500000,
app_name='python-can')
bus2 = can.interface.Bus(bustype='vector', channel=1, bitrate=500000,
app_name='python-can')
msg1 = can.Message(arbitration_id = 0xa1,
data = [1, 2, 3, 4, 5, 6, 7, 8],
extended_id = False)
msg2 = can.Message(arbitration_id = 0xa3,
data = [8, 7, 6, 5, 4, 3, 2, 1],
extended_id = False)
bus1.send(msg1)
time.sleep(1.0)
bus2.send(msg2)
bus1.shutdown()
bus2.shutdown()
我可以导入can模块,但出现以下错误:
AttributeError: module 'can' has no attribute 'interface'
我正在尝试向虚拟CAN发送虚拟消息。如何修复此错误
我今天在使用python can 3.3.3时遇到了这个问题,并通过更新到不久前发布的3.3.4解决了这个问题
由于该软件包仍在开发中,看起来他们无意中发布了一个3.3.3的坏版本
如果pyinstaller 4.0在.py打包为.exe后出现问题,请在代码中添加以下行
相关问题 更多 >
编程相关推荐