Could anyone help me solve the problem of not being able to run my experiment?


截屏2023-11-05 下午7.46.43

macOS Big Sur 11.3
PsychoPy23.2.2 and PsychoPy23.2.3
I try to run the experiment. But my screen always show"Attempting to measure frame rate of screen, please wait…". And then it quit.

Running: /Users/mac/Desktop/materials/02/stroop/stroop_lastrun.py

257.4222 INFO Loaded monitor calibration from [‘2023_09_26 09:37’]
2023-11-05 19:53:55.466 python[5020:256842] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/vh/qq7zz1sn21jfc_5rfs2bt8540000gn/T/org.opensciencetools.psychopy.savedState
12.2432 EXP Created window1 = Window(allowGUI=True, allowStencil=True, autoLog=True, backendConf=UNKNOWN, backgroundFit=<method-wrapper ‘getattribute’ of attributeSetter object at 0x7fc673746cd0>, backgroundImage=<method-wrapper ‘getattribute’ of attributeSetter object at 0x7fc673746c70>, bitsMode=UNKNOWN, blendMode=‘avg’, bpc=(8, 8, 8), color=array([0, 0, 0]), colorSpace=‘rgb’, depthBits=8, fullscr=<method-wrapper ‘getattribute’ of attributeSetter object at 0x7fc673746ac0>, gamma=None, gammaErrorPolicy=‘raise’, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7fc672a861f0>, multiSample=False, name=‘window1’, numSamples=2, pos=(283, 53), screen=0, size=array([800, 800]), stencilBits=8, stereo=False, title=‘PsychoPy’, units=‘height’, useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType=‘pyglet’)
Traceback (most recent call last):
12.2434 EXP window1: mouseVisible = True
12.2434 EXP window1: backgroundImage = ‘’
12.2435 EXP window1: backgroundFit = ‘none’
12.2473 EXP window1: Attempting to measure frame rate of screen (0) …
12.2474 EXP window1: recordFrameIntervals = False
12.4090 EXP window1: recordFrameIntervals = True
12.5928 EXP Screen (0) actual frame rate measured at 60.06Hz
12.5929 EXP window1: recordFrameIntervals = False
12.5930 EXP window1: mouseVisible = True
12.6478 WARNING launchHubServer: If using the iohub mouse or eyetracker devices, fullScr should be True.
42.9619 EXP window1: mouseVisible = True
ioHub Server Process Completed With Code: Negsignal.SIGSEGV
File “/Users/mac/Desktop/materials/02/stroop/stroop_lastrun.py”, line 600, in
inputs = setupInputs(expInfo=expInfo, thisExp=thisExp, win=win)
File “/Users/mac/Desktop/materials/02/stroop/stroop_lastrun.py”, line 210, in setupInputs
ioServer = io.launchHubServer(window=win, **ioConfig)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/contrib/lazy_import.py”, line 118, in call
return obj(*args, **kwargs)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/connect.py”, line 260, in launchHubServer
return ioHubConnection(iohub_config)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/init.py”, line 296, in init
raise RuntimeError(‘Error starting ioHub server: {}’.format(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup failed.
################# Experiment ended with exit code 1 [pid:5020] #################

Does this help?

If you are using eye tracking then there are quite a few posts about the error.

Running: /Users/mac/Desktop/materials/02/stroop/stroop_lastrun.py

2023-11-06 09:45:32.518 python[6726:355594] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/vh/qq7zz1sn21jfc_5rfs2bt8540000gn/T/org.opensciencetools.psychopy.savedState
2023-11-06 09:45:37.373 python[6726:355594] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit

PsychHID-ERROR: During PsychHID invocation: macOS is preventing access to HID input devices like keyboard, keypad and mouse!
PsychHID-ERROR: This is because permission for ‘Input Monitoring’ is denied to Python 64-Bit, or to Terminal.app, if you started Python 64-Bit from a Terminal.
PsychHID-ERROR: Please rectify this manually now:
PsychHID-ERROR:
PsychHID-ERROR: 1. Quit Python 64-Bit, and also Terminal if it was used to launch Python 64-Bit.
PsychHID-ERROR: 2. Open ‘System Preferences’, then go to the ‘Security & Privacy’ control panel.
PsychHID-ERROR: 3. Select the ‘Privacy’ tab, and then in the list on the left, the item ‘Input Monitoring’.
PsychHID-ERROR: 4. Make sure that Python 64-Bit, or similar, or maybe Terminal instead, is listed in the list on the right.
PsychHID-ERROR: E.g., names could be ‘Terminal’ or ‘Octave’ something, or ‘MATLAB_R2020b.app’ or similar for Matlab.
PsychHID-ERROR: 5. Make sure that the checkbox next to the name of the item is checked.
PsychHID-ERROR: 6. Restart Python 64-Bit.
PsychHID-ERROR: 7. Execute the ‘KbCheck’ command as a simple test, which should hopefully work now without errors.
PsychHID-ERROR: 8. If it doesn’t work, retry the procedure - rinse, wash, repeat.
PsychHID-ERROR: 9. If it works without errors, retry if your own scripts or our demos now work again.
PsychHID-ERROR: 10. If none of this works, you may be able to buy paid priority support from us: ‘help PsychPaidSupportAndServices’.

Error in function : Usage error
PsychHID-CRITICAL: PsychHID disabled due to macOS security restrictions! Emergency shutdown! ‘clear all’ or restart your application.

PsychHID:: Usage:

(null)
################ Experiment ended with exit code -11 [pid:6726] ################
78.1458 INFO Loaded monitor calibration from [‘2023_09_26 09:37’]
109.4562 INFO Loaded monitor calibration from [‘2023_09_26 09:37’]

Thank you very much ! I’m changing ioHub to Pyglet. And then it runs successfully.