NotImplementedError: Invalid CAN Bus Type - None

简介: NotImplementedError: Invalid CAN Bus Type - None

连接can


can0 = can.interface.Bus(channel = ‘can0’, bustyp = ‘socketcan_ctypes’)


在python中连接can是会出现下列错误:


/

Traceback (most recent call last):
File “recv.py”, line 10, in
can1 = can.interface.Bus(channel = ‘can1’, bustyp = ‘socketcan_ctypes’)
File “/usr/local/lib/python3.7/dist-packages/can/interface.py”, line 108, in new
kwargs = load_config(config=kwargs, context=context)
File “/usr/local/lib/python3.7/dist-packages/can/util.py”, line 197, in load_config
raise NotImplementedError(‘Invalid CAN Bus Type - {}’.format(config[‘interface’]))
NotImplementedError: Invalid CAN Bus Type - None


解决方法:


在~/下添加 .canrc文件,


sudo vi ~/.canrc


里面填写如下信息


/

[default]
interface = socketcan
channel = can0


问题即可解决

相关文章
|
8月前
|
JavaScript 前端开发
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
296 1
|
前端开发 JavaScript
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
1378 0
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
8月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
150 0
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
|
人工智能 自然语言处理 语音技术
Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决
Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决
150 0
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1732 0
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
程序员 算法框架/工具 Caffe
解决办法:error: 'size_t' does not name a type、unknown type name 'size_t'
解决办法:error: 'size_t' does not name a type、unknown type name 'size_t'
769 0