PsychoPy not running correctly. Error: OSError: dlopen(c, 6): no suitable image found

Version of Psychopy: 1.85.1
OS: Mac OS El Capitan

PsychoPy is not starting experiments. It opens properly, then when I hit the start button, an error message pops up with the error:

“OSError: dlopen(c, 6): no suitable image found. Did find: /usr/local/lib/c: stat() failed with errno=13”

This happens when no experiment is loaded as well as when an experiment is open in builder or in coder view. I have tried installing and uninstalling PsychoPy multiple times. I tried also finding and deleting appData.cfg and userPrefs.cfg, which was suggested on the PsychoPy website. Any help is much appreciated!

-Alexandra

There was probably more info in that error message. It would be good to see all of it.

Meanwhile, it has been reported a few times before and Google points to a couple of (possible) solutions here:

https://groups.google.com/forum/#!topic/psychopy-users/O-Fy4rSZJnw

Here is the whole message:

Running: /Users/alexandrahalberstadt/Desktop/NIH /MST_Files(updated)/MST(updated)_lastrun.py
Unexpected error loading library c: dlopen(c, 6): no suitable image found. Did find:
/usr/local/lib/c: stat() failed with errno=13
Traceback (most recent call last):
File “/Users/alexandrahalberstadt/Desktop/NIH /MST_Files(updated)/MST(updated)_lastrun.py”, line 14, in
from psychopy import locale_setup, gui, visual, core, data, event, logging, sound
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/init.py”, line 17, in
from .window import Window, getMsPerFrame, openWindows
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/window.py”, line 57, in
from psychopy import core, platform_specific, logging, prefs, monitors, event
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/event.py”, line 44, in
from pyglet.window.mouse import LEFT, MIDDLE, RIGHT
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 1817, in
gl._create_shadow_window()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/gl/init.py”, line 205, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 494, in init
display = get_platform().get_default_display()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 1766, in get_default_display
return pyglet.canvas.get_display()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/canvas/init.py”, line 77, in get_display
from pyglet.app import displays
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/app/init.py”, line 177, in
event_loop = EventLoop()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/app/base.py”, line 116, in init
self.clock = clock.get_default()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/init.py”, line 357, in getattr
import(import_name)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/clock.py”, line 168, in
_c = pyglet.lib.load_library(‘c’)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/lib.py”, line 135, in load_library
lib = ctypes.cdll.LoadLibrary(name)
File “ctypes/init.pyc”, line 440, in LoadLibrary
File “ctypes/init.pyc”, line 362, in init
OSError: dlopen(c, 6): no suitable image found. Did find:
/usr/local/lib/c: stat() failed with errno=13

I did see these fixes, but I know no coding, so uninstalling and installing pyglet was kind of confusing. I didn’t know where to type “pip uninstall pyglet” or anything. Thank you so much for pointing this out to me though :slight_smile: If you could explain those fixes more, it might be helpful! Thank you so much for your time!

-Alexandra

If you are just using the standalone version of PsychoPy, you can probably ignore the pyglet installation thing, as you have the right version of pyglet already.

The permissions issue might be relevant though, but at this stage I wonder if anyone else more-technically minded might have something to suggest here?

I am using this program successfully on another laptop (a PC), but I can’t get this to work on my mac. I downloaded the new version of PsychoPy, thinking it might work now. The new version gives me the same error message:

Unexpected error loading library c: dlopen(c, 6): no suitable image found. Did find:
/usr/local/lib/c: stat() failed with errno=13
Traceback (most recent call last):
File “/Users/alexandrahalberstadt/Desktop/NIH/PsychoPy things/MST_Files(not updated) /MST(FINAL-working).py”, line 14, in
from psychopy import locale_setup, gui, visual, core, data, event, logging, sound, parallel
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/init.py”, line 17, in
from .window import Window, getMsPerFrame, openWindows
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/window.py”, line 57, in
from psychopy import core, platform_specific, logging, prefs, monitors, event
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/event.py”, line 44, in
from pyglet.window.mouse import LEFT, MIDDLE, RIGHT
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 1817, in
gl._create_shadow_window()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/gl/init.py”, line 205, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 494, in init
display = get_platform().get_default_display()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/init.py”, line 1766, in get_default_display
return pyglet.canvas.get_display()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/canvas/init.py”, line 77, in get_display
from pyglet.app import displays
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/app/init.py”, line 177, in
event_loop = EventLoop()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/app/base.py”, line 116, in init
self.clock = clock.get_default()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/init.py”, line 357, in getattr
import(import_name)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/clock.py”, line 168, in
_c = pyglet.lib.load_library(‘c’)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/lib.py”, line 135, in load_library
lib = ctypes.cdll.LoadLibrary(name)
File “ctypes/init.pyc”, line 440, in LoadLibrary
File “ctypes/init.pyc”, line 362, in init
OSError: dlopen(c, 6): no suitable image found. Did find:
/usr/local/lib/c: stat() failed with errno=13

If anyone has any additional insight, don’t hesitate to let me know!

@Ahalberstadt Were you able to solve this issue or get around it? If so, how? I’m getting the same one. I tries installing mercurial and getting the other pyglet but that didn’t work for me.