Need Help with Launch Error in PsychoPy - Seeking Solutions

Hi,

I’ve recently encountered a bit of a snag while working with PsychoPy and was wondering if anyone else has experienced something similar or has insights on how to troubleshoot it.

The Issue: I’ve been encountering a launch error when trying to run my experiments in PsychoPy. It worked fine until yesterday when I tried to change the name of the .pyexp file created using builder. I’m curious if anyone else has come across this issue and, if so, how you managed to resolve it.

Additional Context: I’ve been running the latest standalone app on macOS 13.5.1, and I’ve followed the recommended installation steps. The error message I’m encountering is “Launch error See the py2app website for debugging launch issues”

What I’ve Tried: I’ve attempted debugging as the py2app website suggests and re-installed Psychopy. Unfortunately, none of these steps have seemed to fix the issue. I’m attaching the error log at the end of this post.

If anyone has any suggestions, workarounds, or insights on how to resolve this launch error, I’d greatly appreciate your input.

Thanks in advance for your time and expertise!

Best regards,
Heemin

Error log looked like below:

0.6554 DEBUG Opening message catalog /Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/localization/…/app/locale/en_US/LC_MESSAGE/messages.mo for locale en_US
PTB-INFO: Using modified PortAudio V19.7.0-devel, revision unknown
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/_psychopyApp.py”, line 613, in onInit
self.showBuilder(fileList=exps)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/_psychopyApp.py”, line 887, in showBuilder
self.newBuilderFrame(fileName=fileName)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/_psychopyApp.py”, line 872, in newBuilderFrame
self.builder = BuilderFrame(None, -1,
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 215, in init
self.fileOpen(filename=fileName, closeCurrent=False)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 757, in fileOpen
self.updateReadme()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 903, in updateReadme
self.readmeFrame = ReadmeFrame(
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 3190, in init
self.ctrl = utils.MarkdownCtrl(self, file=filename, style=wx.BOTTOM)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/utils.py”, line 514, in init
self.load()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/utils.py”, line 590, in load
self.rawTextCtrl.SetValue(f.read())
File “codecs.pyc”, line 322, in decode
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 15: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/boot.py”, line 258, in
_run()
File “/Applications/PsychoPy.app/Contents/Resources/boot.py”, line 172, in _run
exec(compile(source, path, “exec”), globals(), globals())
File “/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py”, line 103, in
main()
File “/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py”, line 99, in main
start_app()
File “/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py”, line 27, in start_app
_ = startApp(showSplash=showSplash) # main loop
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/init.py”, line 84, in startApp
_psychopyApp = PsychoPyApp(
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/_psychopyApp.py”, line 236, in init
self.onInit(testMode=testMode, **kwargs)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/_psychopyApp.py”, line 622, in onInit
).format(exps, traceback.format_exception_only(err)))
TypeError: format_exception_only() missing 1 required positional argument: ‘value’
wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this” failed at /Users/robind/projects/bb2/dist-osx-py38/build/ext/wxWidgets/src/common/wincmn.cpp(470) in ~wxWindowBase(): any pushed event handlers must have been removed

The above exception was the direct cause of the following exception:

SystemError: <class ‘wx._core.WindowDestroyEvent’> returned a result with an error set
wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this” failed at /Users/robind/projects/bb2/dist-osx-py38/build/ext/wxWidgets/src/common/wincmn.cpp(470) in ~wxWindowBase(): any pushed event handlers must have been removed

The above exception was the direct cause of the following exception:

SystemError: <class ‘wx._core.WindowDestroyEvent’> returned a result with an error set
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this” failed at /Users/robind/projects/bb2/dist-osx-py38/build/ext/wxWidgets/src/common/wincmn.cpp(470) in ~wxWindowBase(): any pushed event handlers must have been removed
17.2690 DEBUG Looking for Tobii device configuration file…
19.9881 DEBUG Looking for SR Research EyeLink device configuration file…
19.9884 DEBUG No SR Research EyeLink device configuration file found.
19.9884 DEBUG Looking for Gazepoint device configuration file…
20.0075 DEBUG Looking for PupilLabs device configuration file…
23.5848 INFO Trying to load audio library: sounddevice
23.5872 ERROR Support for the sounddevice audio backend is not available this session. Please install psychopy-sounddevice and restart the session to enable support.
23.5872 INFO Trying to load audio library: PTB
23.6028 INFO Loaded psychtoolbox audio version 3.0.18.606399286
23.6030 INFO sound is using audioLib: ptb
23.8525 WARNING image was set to update during ISI_load_images Static Component, but that component no longer exists
23.8526 WARNING image was set to update during ISI_load_images Static Component, but that component no longer exists
23.8526 WARNING image was set to update during ISI_load_images Static Component, but that component no longer exists
23.8526 WARNING image was set to update during ISI_load_images Static Component, but that component no longer exists
23.8526 WARNING image was set to update during ISI_load_images Static Component, but that component no longer exists

To follow up on this inquiry, I have temporarily solved this problem by following this forum (Audio library not appearing in Preferences (Mac)).
So what I did was to downgrade Psychopy to Version 2022.2.5, and then it works without any issues. After changing audio preferences (i.e., deleting sounddevice) I re-installed the up-to-date version (2023.1.2), but the launch error came back. So as long as I don’t find any permanent or better solution, I assume that I should keep using the older version.

I am getting the same error message. It’s come up out of the blue today.

I just started experiencing this launch error today. I was updating a working experiment when suddenly it wouldn’t run. I closed PsychoPy and on re-opening it gave me the launch error.

I have deleted and reinstalled the latest version and also tried downgrading to 2022.2.5 with no luck.

I’m not sure exactly how I’d apply the instructions in the py2app page to go through the debugging process.

I’d love to hear if anyone has come up with a fix.