psychopy.org | Reference | Downloads | Github

Sound crashes with macOS High Sierra 10.13.4

After an OS upgrade I cannot run any Psychopy scripts with sound (including Demos). I am running Standalone PsychoPy 1.90.1

Assistance very much appreciated!

See error message:

Running: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/stimuli/soundStimuli.py

Traceback (most recent call last):
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/stimuli/soundStimuli.py”, line 22, in
from psychopy import sound, core
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/init.py”, line 79, in
from . import backend_sounddevice as backend
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/sound/backend_sounddevice.py”, line 20, in
import soundfile as sf
File “soundfile/init.pyc”, line 1, in
File “soundfile/soundfile.pyc”, line 270, in
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py”, line 141, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py”, line 802, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/cffi/api.py”, line 797, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library ‘/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib’: dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib, 2): no suitable image found. Did find:
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib: stat() failed with errno=20. Additionally, ctypes.util.find_library() did not manage to locate a library called ‘/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/soundfile/_soundfile_data/libsndfile.dylib’

Ok - found the solution. For some reason the site-packages are not automatically unzipped and therefore psychopy cannot find critical contents. When I manually unzipped the site-packages folder and deleted the .zip-file things started working

2 Likes

Hello,

Thank you so much!

This solved my problem too!

This is annoying. I thought I’d managed to get libsndfile.dylib packaged outside that zip file, but you’re still having a problem with it. @mbermonti which exact version did you install please?

I was using psychopy 1.90.3. I’m now using version 8.15.6. I actually switched versions because this one seemed more stable (1.90.3 didn’t load my experiments for some reason after I closed and reopen them) and I didn’t have the sound library problems with 8.15.6.