psychopy.org | Reference | Downloads | Github

Error cannot load library when running a basic stroop task


#1

Hi, I’m VERY new to this… and with programming in general. This actually is my first trial.

OS Mac OSX 10.11.6
PsychoPy version : 1.90.dev1
Standard Standalone? (y/n) : ?
What are you trying to achieve?:

I have followed the instructions from the youtube tutorial "Build your first PsychoPy experiment (Stroop task)"
nb: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12)
What did you try to make it work?:
Hit the run button
What specifically went wrong when you tried that?:
got the following error message:

OSError: cannot load library /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib, 2): no suitable image found. Did find:
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: stat() failed with errno=20

Thank you in advance for ANY assistance!


#2

Hi, I’m also totally new to PsychoPy. I know some coding but nothing about loading dylibs. Tried running from both the coder and the builder and got the same exact error message, word for word.

OS Mac OSX 10.13.2
PsychoPy version : 1.90.dev1
Standard Standalone? (y/n) : Yes

@Cochonnet any progress on this? Found this help page for the dlopen function, but I didn’t find anything in there referring to the “no suitable image found”. I noticed the path to the dylib contains a zip file, is this normal? I also looked inside site-packages.zip and found no folder called “_sounddevice_data”, so my best guess is that this is the problem.


#3

Thanks for your response! Yes i have noticed that too but I really don’t know how to fix the problem… The software contains several demos which I believe are somewhat related to the “site-package” file. I have tried to install them, they appear now in the menu, but I have the same error message when I try to run them.


#4

I have the same exact problem. I download everything and follow all installation steps. But when I hit the “Run” button the same error appear to me.
OSError: cannot load library /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib, 2): no suitable image found. Did find:
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: stat() failed with errno=20

If anyone could help I will really appreciate it!


#5

Hi,

I noticed too, that “site-packages.zip” folder, and I unzipped it to see files, and folder “_sounddevice_data”, does not exist.

The same problem, same psychopy version, same operative system (OSX - macbook)… I have tried to install from terminal “pip install sounddevice”, but does not work yet!

Help!


#6

Hi,

I have exactly the same problem. I cannot run any type of experiment, same error message.

Help please!


#7

I also have the same problem(see below psychopy output). I want to run demos but I can’t :(.
Is there anyone who knows how to fix this???

######### Running: /Users/WhyJay/Documents/stroop_tutorial_lastrun.py ##########
Traceback (most recent call last):
File “/Users/WhyJay/Documents/stroop_tutorial_lastrun.py”, line 14, in
from psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clock
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’


#8

I encountered the same problem with PsychoPy1.90.1. I grabbed the Python3 dmg instead and this allows me to run the stroop demo without problems.


#9

ok so i found a temporary fix:

go to preferences for psychopy, and under the General tab find “audio library”. there should be 3 items there: [u’sounddevice’, u’pyo’, u’pygame’, ]. delete “u’sounddevice’ " so that only " u’pyo’, u’pygame’,” are in the brackets. Apply these changes and stroop as well as other tests should work!


#10

Thanks, but I didn’t work for me…

OSError: cannot load library /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: dlopen(/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib, 2): no suitable image found.  Did find:
    /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/site-packages.zip/_sounddevice_data/libportaudio.dylib: stat() failed with errno=20

Even though, I’m using my Mac just to write and check the code, because at the MRI we have a Windows. Thanks.


#11

Thank you very much. This worked!!


#12

Many thanks! This worked for me too.


#13

Amazing! This worked for me as well! :grinning: