Help with Error please

Any help very much appreciated!

OSMac
PsychoPy version 3
**Standard Standalone? y
What are you trying to achieve?: Run a simple task.

What did you try to make it work?: The task works fine on 2 other computers and with older psychopy versions but …

What specifically went wrong when you tried that?: This does not work with two of my other students mac’s. We get this error after running and entering participant number:

Generating PsychoPy script…

Running: /Users/priscillaagyei/Documents/ERP FINAL DOWNLOAD copy/CPT/CPT_JG_2019_lastrun.py

PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!
PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers
PsychHID-ERROR: or applications. I will now retry to only claim control of a hopefully safe subset of devices like standard
PsychHID-ERROR: keyboards, mice, gamepads and supported USB-DAQ devices and other vendor defined devices and hope this goes better…
PsychHID-INFO: That worked. A subset of regular mouse, keyboard etc. input devices and maybe some vendor defined devices will be available at least.
INTERNAL PSYCHTOOLBOX ERROR
error: PsychError_system
general description: Error reported by a system call
specific description: Failed to create event queue for detecting key press.
module name: PsychHID
subfunction call: KbQueueCreate
file name: ./PsychSourceGL/Source/OSX/PsychHID/PsychHIDStandardInterfaces.c
function name: PsychHIDOSKbQueueCreate
line number: 956
PsychHID:KbQueueCreate: See error message printed above.
2020-01-30 15:14:49.294 python[2835:122661] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
File “/Users/priscillaagyei/Documents/ERP FINAL DOWNLOAD copy/CPT/CPT_JG_2019_lastrun.py”, line 78, in
defaultKeyboard = keyboard.Keyboard()
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 166, in init
buffer = _keyBuffers.getBuffer(devId, bufferSize)
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 306, in getBuffer
kb_id=kb_id)
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 334, in init
self.dev = hid.Keyboard(kb_id) # a PTB keyboard object
File “psychtoolbox/hid.pyc”, line 137, in init
File “psychtoolbox/hid.pyc”, line 145, in _create_queue
FileNotFoundError: [Errno 2] No such file or directory

Generating PsychoPy script…

Running: /Users/priscillaagyei/Documents/ERP FINAL DOWNLOAD copy/CPT/CPT_JG_2019_lastrun.py

PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!

PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers

PsychHID-ERROR: or applications. I will now retry to only claim control of a hopefully safe subset of devices like standard

PsychHID-ERROR: keyboards, mice, gamepads and supported USB-DAQ devices and other vendor defined devices and hope this goes better…

PsychHID-INFO: That worked. A subset of regular mouse, keyboard etc. input devices and maybe some vendor defined devices will be available at least.

INTERNAL PSYCHTOOLBOX ERROR

error:                PsychError_system 

general description:  Error reported by a system call 

specific description: Failed to create event queue for detecting key press. 

module name:          PsychHID 

subfunction call:     KbQueueCreate 

file name:            ./PsychSourceGL/Source/OSX/PsychHID/PsychHIDStandardInterfaces.c 

function name:        PsychHIDOSKbQueueCreate 

line number:          956 

PsychHID:KbQueueCreate: See error message printed above.

2020-01-30 15:14:49.294 python[2835:122661] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)

Traceback (most recent call last):

File “/Users/priscillaagyei/Documents/ERP FINAL DOWNLOAD copy/CPT/CPT_JG_2019_lastrun.py”, line 78, in

defaultKeyboard = keyboard.Keyboard()

File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 166, in init

buffer = _keyBuffers.getBuffer(devId, bufferSize) 

File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 306, in getBuffer

kb_id=kb_id)

File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/hardware/keyboard.py”, line 334, in init

self.dev = hid.Keyboard(kb_id) # a PTB keyboard object

File “psychtoolbox/hid.pyc”, line 137, in init

File “psychtoolbox/hid.pyc”, line 145, in _create_queue

FileNotFoundError: [Errno 2] No such file or directory

@James_Gilleen1, which version of PsychoPy is this?

Hi,

Cheers,

J

Thianks, but can you provide the specific release, e.g., 3.0.0, or 3.2.4. It is useful to know in case this is a bug that was already fixed.

I had the same problem with an experiment, which worked a week ago and I did not change anything. I was running PsychoPy 3.2.4. Uninstalling PsychoPy and reinstalling it solved the problem.
Originally I thought PsychoPy lost the keyboard access (System Preferences > Security and Privacy > Input Monitoring), but it was still there and checked. Not sure what caused the change since last week, but I think there was a MacOS update which might have disrupted some settings.

1 Like

My student replied saying it now suddenly works.

“I had to right click on the app and then click ‘show contents’ from there I clicked the MacOS file and clicked psychopy”.

So, there you go! At least it now works. Thanks for the prompt replies.

1 Like

I’m getting the same error but with a new Windows 10 PC (https://www.lenovo.com/gb/en/laptops/ideapad/s-series/IdeaPad-5-15ARE05/p/88IPS501393)

I am using the latest psychopy standalone version 2020.2.8

The experiment was working up until yesterday but then I added a new routine and it did not include the new routine (it just used the lastrun.py which did not include the new routine). Then I deleted the lastrun.py and the runner gives me this error:

C:\Program Files\PsychoPy3\python.exe: can’t open file ‘C:\Users\Blyth\OneDrive - University of Bristol\Psychopy\StudentProjects\Mairead2020v2\new_lastrun.py’: [Errno 2] No such file or directory

Experiment ended.

It seems there are solutons regarding privacy settings with mac (eg. keyboard access or "right click on the app and then click ‘show contents’ then click thr MacOS file and then psychopy”.).This thread also seems to be successful with macs:

Keyboard psychtoolbox/hid failing with Mac OS Catalina update - #4 by fheiuap

but how do something similar with Windows?

1 Like

Could you get any solution?

I’m having the exact same problem.
PsychoPy is not creating the lastrun file, so the experiment doesn’t run (or run in an older version, although there are new routines in the flow).

1 Like