Path problem

With a django project, if I try runserver, I get this:

/usr/bin/python runserver 8000

Unhandled exception in thread started by <bound method Command.inner_run of < object at 0x1078d2850>>

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/django/core/management/commands/", line 91, in inner_run


  File "/Library/Python/2.7/site-packages/django/core/management/", line 266, in validate

    num_errors = get_validation_errors(s, app)

  File "/Library/Python/2.7/site-packages/django/core/management/", line 23, in get_validation_errors

    from django.db import models, connection

  File "/Library/Python/2.7/site-packages/django/db/", line 40, in <module>

    backend = load_backend(connection.settings_dict['ENGINE'])

  File "/Library/Python/2.7/site-packages/django/db/", line 34, in __getattr__

    return getattr(connections[DEFAULT_DB_ALIAS], item)

  File "/Library/Python/2.7/site-packages/django/db/", line 92, in __getitem__

    backend = load_backend(db['ENGINE'])

  File "/Library/Python/2.7/site-packages/django/db/", line 24, in load_backend

    return import_module('.base', backend_name)

  File "/Library/Python/2.7/site-packages/django/utils/", line 35, in import_module


  File "/Library/Python/2.7/site-packages/django/db/backends/mysql/", line 16, in <module>

    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/leehinde/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/, 2): Library not loaded: libmysqlclient.18.dylib

  Referenced from: /Users/leehinde/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/

  Reason: image not found

The same command works fine if I run it from terminal.
I've seen past comments about path settings (  and the tips seem to be out of date, for Lion.  I'd appreciate any current advice.
(mac, Lion)

Please make sure that any environment variables needed for libraries to be resolved correctly are defined in launchd.conf, not in your bash profile:



I'm not sure what I'm supposed to be setting there. Why isn't the configuration within the prefs dialog sufficient?


Please sign in to leave a comment.