# OSError: sndfile library not found

**URL:** <https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115>\
**Category:** Builder\
**Created:** [August 20, 2018, 12:19pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115 "2018-08-20T12:19:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![suelynnmah](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@suelynnmah](https://discourse.psychopy.org/u/suelynnmah)\
**Post date:** [August 20, 2018, 12:19pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/1 "2018-08-20T12:19:25Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10): MacOSSierra 10.12.6  
**PsychoPy version** (e.g. 1.84.x): Psychopy v3.0.0b7  
**Standard Standalone? (y/n)** If not then what?: Yes  
**What are you trying to achieve?:**  
present 2 stimuli and 4 choice answers (clickable by mouse)

**What did you try to make it work?:**

 ![game%20capture](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/c/8ca39f2323d7b90bc43fff0757b1ff44e9e3e2c2.jpeg)  
**What specifically went wrong when you tried that?:**

I got this error message

########### Running: /Users/lpxslma/Desktop/foodGame/game\_lastrun.py ###########  
Traceback (most recent call last):  
File “soundfile.pyc”, line 142, in   
OSError: sndfile library not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/Users/lpxslma/Desktop/foodGame/game\_lastrun.py”, line 14, in   
from psychopy import locale\_setup, sound, gui, visual, core, data, event, logging, clock  
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/sound/ **init**.py”, line 79, in   
from . import backend\_sounddevice as backend  
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/sound/backend\_sounddevice.py”, line 20, in   
import soundfile as sf  
File “”, line 961, in \_find\_and\_load  
File “”, line 950, in \_find\_and\_load\_unlocked  
File “”, line 646, in \_load\_unlocked  
File “”, line 616, in \_load\_backward\_compatible  
File “soundfile.pyc”, line 163, in   
OSError: cannot load library ‘/Applications/PsychoPy3.app/Contents/Resources/lib/\_soundfile\_data/libsndfile.dylib’: dlopen(/Applications/PsychoPy3.app/Contents/Resources/lib/\_soundfile\_data/libsndfile.dylib, 2): image not found

I’m not sure why there’s a sound library error when i did not use any sound component. Also, I’ve checked that all the images I want to use is saved in the folder.

---

<div class="post-metadata">

**Author:** ![jennifer.culbertson](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jennifer.culbertson](https://discourse.psychopy.org/u/jennifer.culbertson)\
**Post date:** [August 21, 2018, 12:20pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/2 "2018-08-21T12:20:46Z")

</div>

I have this exact same issue on clean install of StandalonePsychoPy3-3.0.0b7-MacOS.dmg on OS 10.12.6. Demos without sound (e.g., hello\_world, clockface) work fine, but soundStimuli.py does not.

---

<div class="post-metadata">

**Author:** ![suelynnmah](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@suelynnmah](https://discourse.psychopy.org/u/suelynnmah)\
**Post date:** [August 21, 2018, 12:39pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/3 "2018-08-21T12:39:57Z")

</div>

hi jennifer, i redid my experiment on the 1.9 version and it loaded so it might be a bug in this latest version 😕

---

<div class="post-metadata">

**Author:** ![Mears-UFL](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mears-UFL](https://discourse.psychopy.org/u/Mears-UFL)\
**Post date:** [August 21, 2018, 3:10pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/4 "2018-08-21T15:10:23Z")

</div>

I had the same problem with the stroop demo with a fresh install of StandalonePsychoPy3-3.0.0b7-MacOS on macOS HighSierra. Version b7 is the first version to work on my computer, so this is good. The thing with the stroop demo is that there shouldn’t be any sound, so I found that the default preferences were the problem. When I deleted all sound preferences, the (silent ) stroop demo now will work.

 ![sound_pref](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/d/bdddeca5eb3b45411a038b8b594c30722916ca4f.jpeg)  
-R

---

<div class="post-metadata">

**Author:** ![suelynnmah](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@suelynnmah](https://discourse.psychopy.org/u/suelynnmah)\
**Post date:** [August 22, 2018, 1:37pm UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/5 "2018-08-22T13:37:27Z")

</div>

thanks for letting me know! it works like a charm now 🙂

---

<div class="post-metadata">

**Author:** ![jennifer.culbertson](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jennifer.culbertson](https://discourse.psychopy.org/u/jennifer.culbertson)\
**Post date:** [August 23, 2018, 9:48am UTC](https://discourse.psychopy.org/t/oserror-sndfile-library-not-found/5115/6 "2018-08-23T09:48:36Z")

</div>

Likewise! Thanks!
