Launch Error Mac

Hi,

PsychoPy used to work on my Mac. I saved an experiment and now I get this message whenever I try to open PsychoPy: Launch error
See the py2app website for debugging launch issues

Can anyone help me?

What version are you trying to launch?

Becca

Did anyone figure this out? I have tried 2022.2.4, 2022.2.3, 2022.2.2 using MacOS 10.95

If you’re using macos 10.9.5 I wonder if that’s just too old a version of the operating system (that was released 8 years ago). Certainly I don’t have a machine to test on with that version of macos.

But you might be able to get a more informative error message from PsychoPy error logging. Could you go to the terminal and do this:

cat ~/.psychopy3/last_app_load.log

Hi, same issue here: Just downloaded and installed the Standalone 2022.2.5. for macOS from Installation — PsychoPy v2023.1.0 and get the same launch error. My OS is 12.6.3 though, so I don’t think that’s too old.

And when you go to terminal and paste in
cat ~/.psychopy3/last_app_load.log
what does it say?

Basically, I can’t replicate this on my own mac computers (including one running MacOS 12.6) so we need more information to have a guess at what’s going wrong

I get this -Terry Acree M1 processor; running Mac OS 13.2.1 (with a separate install of Python 3.11.2)

/builder/builder.py", line 125, in <module>
    class BuilderFrame(BaseAuiFrame, handlers.ThemeMixin):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py", line 128, in BuilderFrame
    routineTemplates = TemplateManager()
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py", line 110, in __init__
    self.updateTemplates()
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py", line 117, in updateTemplates
    thisExp = experiment.Experiment()
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py", line 137, in __init__
    _settingsComp = getComponents(fetchIcons=False)['SettingsComponent']
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/__init__.py", line 218, in getComponents
    module = import_module(explicit_rel_path, package=pkg)
  File "importlib/__init__.pyc", line 127, in import_module
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/microphone/__init__.py", line 15, in <module>
    from psychopy.sound.audiodevice import sampleRateQualityLevels
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/sound/__init__.py", line 120, in <module>
    raise ValueError(msg)
ValueError: audioLib pref should be one of ['PTB', 'sounddevice', 'pyo', 'pysoundcard', 'pygame'], not "'PTB'"
terryeacree@dhcp-vl2042-25342 ~ %

@albietz in your case that looks like the prefs for your audio lib have been set incorrectly (using quotes that aren’t necessary)

Could you tell us:

  • what exact version of PsychoPy you’re using?
  • the output when you put this in the terminal:
    grep audio ~/.psychopy3/userPrefs.cfg

thanks

Blockquote 0.2577 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
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 102, in
main()
File “/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py”, line 98, in main
start_app()
File “/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py”, line 26, in start_app
app = startApp(showSplash=showSplash)
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 453, in onInit
from psychopy.app import coder, builder, runner, dialogs
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/init.py”, line 5, in
from .builder import BuilderFrame
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 125, in
class BuilderFrame(BaseAuiFrame, handlers.ThemeMixin):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 128, in BuilderFrame
routineTemplates = TemplateManager()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 110, in init
self.updateTemplates()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 117, in updateTemplates
thisExp = experiment.Experiment()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 137, in init
_settingsComp = getComponents(fetchIcons=False)[‘SettingsComponent’]
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/init.py”, line 218, in getComponents
module = import_module(explicit_rel_path, package=pkg)
File “importlib/init.pyc”, line 127, in import_module
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/microphone/init.py”, line 15, in
from psychopy.sound.audiodevice import sampleRateQualityLevels
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/sound/init.py”, line 135, in
raise DependencyError(
psychopy.exceptions.DependencyError: No sound libs could be loaded. Tried: [‘pygame’]
Check whether the necessary sound libs are installed

I am running 2023.1.1, as per the tooltip and the version download.

What follows is the exact terminal output when I ran bulletpoint 2:

terryeacree@dhcp-vl2042-8338 ~ % grep audio ~/.psychopy3/userPrefs.cfg
    # choice of audio library
    audioLib = sounddevice, pyo, pygame
    # audio driver to use
    audioDriver = coreaudio, portaudio
    # audio device to use (if audioLib allows control)
    audioDevice = default,
    # path to flac (lossless audio compression) on this operating system
    # Google Cloud Platform key, required for the audio transcription using Google Speech Recognition. Specified as a path to a JSON file containing the key data.
    # choice of audio library
    audioLib = "'PTB'", sounddevice, pyo, pygame
    # audio driver to use
    audioDriver = coreaudio, portaudio
    # audio device to use (if audioLib allows control)
    audioDevice = default,
    # latency mode for PsychToolbox audio (3 is good for most applications. See
    audioLatencyMode = 3
terryeacree@dhcp-vl2042-8338 ~ % 

So @albietz in your case the problem is the line
audioLib = "'PTB'", sounddevice, pyo, pygame
Note the quotes around the PTB? They shouldn’t be there. You need to edit that file set that line to be
audioLib = PTB, sounddevice, pyo, pygame
I’m afraid I have no idea how it became like that but maybe someone added the quotes in your application prefs

@ASG in your case I think your preferences are set only to use pygame and that can no longer be packaged with MacOS standalone (when I last checked it failed to code-sign with the new MacOS gatekeeper)

So you also probably need to edit the file ~/.psychopy3/userPrefs.cfg and I would also recommend setting
audioLib = PTB, sounddevice