我正在尝试从耳机 Emotiv Epoc 的 SDK 编译一个文件。但是当我编译它时,我收到了这个错误信息:
"Traceback (most recent call last):
File "emotiv.py", line 419, in
a.setup()
File "emotiv.py", line 232, in setup
self.setupWin()
File "emotiv.py", line 305, in setupWin
gevent.spawn(self.setupCrypto, self.serialNum)
AttributeError: 'Emotiv' object has no attribute 'serialNum'"
我检查了给我这个错误的代码:
def setupWin(self):
devices = []
try:
for device in hid.find_all_hid_devices():
if device.vendor_id != 0x21A1:
continue
if device.product_name == 'Brain Waves':
devices.append(device)
device.open()
self.serialNum = device.serial_number
device.set_raw_data_handler(self.handler)
elif device.product_name == 'EPOC BCI':
devices.append(device)
device.open()
self.serialNum = device.serial_number
device.set_raw_data_handler(self.handler)
elif device.product_name == '00000000000':
devices.append(device)
device.open()
self.serialNum = device.serial_number
device.set_raw_data_handler(self.handler)
gevent.spawn(self.setupCrypto, self.serialNum)**<-- the error line**
gevent.spawn(self.updateStdout)
我需要这个用于学校项目。我是 python 新手,所以我不知道会是什么,我已经在 emokit sdk 站点上发布了这个问题,但我没有得到答案。这是整个代码的网站:https ://github.com/openyou/emokit/blob/master/python/emokit/emotiv.py 任何帮助将不胜感激。