Psychopy论坛原帖地址:https://discourse.psychopy.org/t/error-in-function-kbqueuecreate-incorrect-argument-type-supplied/21243
该问题的错误信息形式如下:
Error in function KbQueueCreate: Incorrect argument type supplied
Discrepancy between a specified and supplied argument:
Specified Argument Description:
direction: Input
position: 6
presence:
formats allowed:
unclassified
minimum M: 1
maximum M: 1
minimum N: 1
maximum N: 1
minimum P: 1
maximum P: 1
Provided Argument Description:
direction: Input
position: 6
presence: present
format: int32
number of dimensions: 0
M: 1
N: 1
P: 1
PsychHID:KbQueueCreate: Usage:
PsychHID('KbQueueCreate', [deviceNumber][, keyFlags=all][, numValuators=0][, numSlots=10000][, flags=0][, windowHandle=0])
Traceback (most recent call last):
File "....py", line ..., in <module>
defaultKeyboard = keyboard.Keyboard()
File "...\psychopy\hardware\keyboard.py", line 166, in __init__
buffer = _keyBuffers.getBuffer(devId, bufferSize)
File "...\psychopy\hardware\keyboard.py", line 356, in getBuffer
kb_id=kb_id)
File "...\psychopy\hardware\keyboard.py", line 395, in __init__
self.dev = hid.Keyboard() # a PTB keyboard object
File "...\psychtoolbox\hid.py", line 137, in __init__
self._create_queue(buffer_size)
File "...\psychtoolbox\hid.py", line 145, in _create_queue
None, 0, num_slots, flags, win_handle)
TypeError: Incorrect argument type supplied
该错误发生原因是psychtoolbox版本不兼容,卸载后重新安装3.0.16版本即可。