pedrotorres pedrotorres - 1 year ago 166
Python Question

OSError: dlopen(libSystem.dylib, 6): image not found

Just updated my Mac to El Capitan 10.11.
I am trying to run Django 1.6 with Celery 3.1 and I'm getting this error now:

Unhandled exception in thread started by <function wrapper at 0x10f861050>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/", line 93, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/", line 101, in inner_run
File "/Library/Python/2.7/site-packages/django/core/management/", line 310, in validate
num_errors = get_validation_errors(s, app)
File "/Library/Python/2.7/site-packages/django/core/management/", line 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Library/Python/2.7/site-packages/django/db/models/", line 196, in get_app_errors
File "/Library/Python/2.7/site-packages/django/db/models/", line 75, in _populate
self.load_app(app_name, True)
File "/Library/Python/2.7/site-packages/django/db/models/", line 99, in load_app
models = import_module('%s.models' % app_name)
File "/Library/Python/2.7/site-packages/django/utils/", line 40, in import_module
File "/Library/Python/2.7/site-packages/debug_toolbar/", line 9, in <module>
File "/Library/Python/2.7/site-packages/debug_toolbar/", line 215, in patch_all
File "/Library/Python/2.7/site-packages/debug_toolbar/", line 203, in patch_root_urlconf
File "/Library/Python/2.7/site-packages/django/core/", line 503, in reverse
app_list = resolver.app_dict[ns]
File "/Library/Python/2.7/site-packages/django/core/", line 329, in app_dict
File "/Library/Python/2.7/site-packages/django/core/", line 267, in _populate
for pattern in reversed(self.url_patterns):
File "/Library/Python/2.7/site-packages/django/core/", line 365, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Library/Python/2.7/site-packages/django/core/", line 360, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/Library/Python/2.7/site-packages/django/utils/", line 40, in import_module
File "/Users/pedrotorres/Documents/work/projects/bparts/netpecasv2/", line 10, in <module>
url(r'', include('Common.urls')),
File "/Library/Python/2.7/site-packages/django/conf/urls/", line 26, in include
urlconf_module = import_module(urlconf_module)
File "/Library/Python/2.7/site-packages/django/utils/", line 40, in import_module
File "/Users/pedrotorres/Documents/work/projects/bparts/Common/", line 3, in <module>
from APIMobile.views import request_product_info_by_qrcode
File "/Users/pedrotorres/Documents/work/projects/bparts/APIMobile/", line 9, in <module>
from Common.views import resizeImage, token_generator, getWatermarkImage, filterProductsByBrandModelVersionYear, \
File "/Users/pedrotorres/Documents/work/projects/bparts/Common/", line 34, in <module>
from Common.tasks import turn_off_demo_mode_new_workshop
File "/Users/pedrotorres/Documents/work/projects/bparts/Common/", line 3, in <module>
from netpecasv2.celeryapp import app
File "/Users/pedrotorres/Documents/work/projects/bparts/netpecasv2/", line 5, in <module>
from celery import Celery
File "/Library/Python/2.7/site-packages/celery/", line 130, in <module>
from celery import five
File "/Library/Python/2.7/site-packages/celery/", line 51, in <module>
from kombu.five import monotonic
File "/Library/Python/2.7/site-packages/kombu/", line 52, in <module>
libSystem = ctypes.CDLL('libSystem.dylib')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libSystem.dylib, 6): image not found

Everything worked fine before.
Can't find a solution to fix this. I've seen this thread but doesn't work:
"OSError: dlopen(libSystem.dylib, 6): image not found" (OS X + macports + Celery 3.1.7)

I didn't have any DYLD_FALLBACK_LIBRARY_PATH before. I tried to:


but Python can't find the Library despite it being located under "/usr/lib"

Anyone has had a problem like this?

Answer Source

I suspect (but can't confirm) the System Integrity Protection (SIP) of OSX El Capitan is preventing access to your /usr/lib folder.

It would be extreme and defeating the purpose of the security feature, but you could try disabling SIP by booting into the OS X Recovery partition, executing csrutil disable and rebooting...atleast until another option / work-around can be found.

ArsTechnica has a write-up here:

And a similar issue is described here:

More discussion on Hacker News here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download