windows环境下 pycharm中运行报错 AttributeError: 'NoneType' object has no attribute 'set_configuration'


C:\Users\17964\Anaconda3\envs\pytorch\python.exe E:/project/craves_control/craves_control/demo_control.py
E:\project\craves_control\craves_control\utils\trans.py:1926: UserWarning: No module named 'craves_control.utils._transformations'
  warnings.warn(str(err))
usb cam started!
Traceback (most recent call last):
  File "E:/project/craves_control/craves_control/demo_control.py", line 32, in <module>
    arm_ctl = usb_arm.Arm()  # init arm controller
  File "E:\project\craves_control\craves_control\hardware\usb_arm.py", line 70, in __init__
    self.dev.set_configuration()
AttributeError: 'NoneType' object has no attribute 'set_configuration'

Process finished with exit code 1

认真看报错提示就知道了。

No module named 'craves_control.utils._transformations

这个是关键。

报错不是已经告诉你很具体了
self.dev.set_configuration()
这句代码报错,错误原因是None没有set_configuration这个属性
也就是说dev是none
那你就跟踪看看dev为什么会是none啊