Search code examples
pythondjangowsgiosx-yosemitebitnami

"Symbol not found: __cg_jpeg_resync_to_restart" with djangostack


I'm trying to connect Django 1.6.10-0 to a project that was previously running on 1.5.

After editing the wsgi.py file in my project to include the project path, I get this error:

mod_wsgi (pid=6805): Exception occurred processing WSGI script '/Users/Dreadfort/Documents/MyProject/project/wsgi.py'.
 Traceback (most recent call last):
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
     self.load_middleware()
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/core/handlers/base.py", line 44, in load_middleware
     for middleware_path in settings.MIDDLEWARE_CLASSES:
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
     self._setup(name)
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
     self._wrapped = Settings(settings_module)
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/conf/__init__.py", line 128, in __init__
     mod = importlib.import_module(self.SETTINGS_MODULE)
   File "/Applications/djangostack-1.6.10-0/apps/django/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
     __import__(name)
   File "/Users/Dreadfort/Documents/MyProject/project/__init__.py", line 5, in <module>
     from .celery import app as celery_app
   File "/Users/Dreadfort/Documents/MyProject/project/celery.py", line 5, in <module>
     from celery import Celery
   File "/Applications/djangostack-1.6.10-0/python/lib/python2.7/site-packages/celery/__init__.py", line 130, in <module>
     from celery import five
   File "/Applications/djangostack-1.6.10-0/python/lib/python2.7/site-packages/celery/five.py", line 51, in <module>
     from kombu.five import monotonic
   File "/Applications/djangostack-1.6.10-0/python/lib/python2.7/site-packages/kombu/five.py", line 54, in <module>
     use_errno=True)
   File "/Applications/djangostack-1.6.10-0/python/lib/python2.7/ctypes/__init__.py", line 365, in __init__
     self._handle = _dlopen(self._name, mode)
 OSError: dlopen(/System/Library/Frameworks/CoreServices.framework/CoreServices, 6): Symbol not found: __cg_jpeg_resync_to_restart
   Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
   Expected in: /Applications/djangostack-1.6.10-0/common/lib/libJPEG.dylib
  in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib

My wsgi.py file looks like this:

import os, sys

sys.path.append('/Users/Dreadfort/Documents/MyProject')
sys.path.append('/Users/Dreadfort/Documents/MyProject/project')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

I've never seen anything like it before, so let me know what else you might need to see to help. Thanks in advance!


Solution

  • Try this:

        cd /Applications/djangostack-1.6.10-0/common/lib/
        mv libJPEG.dylib libJPEG.dylib.backup
        ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib libJPEG.dylib
        mv libPng.dylib libPng.dylib.backup
        ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libPng.dylib libPng.dylib
    

    MAMP : dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library