Hello folks,

This probably has been discussed many times, but I still can't find any 
solution yet. Basically, it turns out that python can load MySQLdb just 
fine, but Apache can't load MySQLdb from the wsgi script.

I am using python2.7 in a virtual environment created by virtualenv. Here is 
the error info extracted from the Apache error log. To make the lines 
shorter, I deleted all the time tags in the brackets.

Any ideas how to fix it?

[] mod_wsgi (pid=3136): Target WSGI script 
'/Users/jianbao/projects/tao.com/mysite/apache/django.wsgi' cannot be loaded 
as Python module.
[] mod_wsgi (pid=3136): Exception occurred processing WSGI script 
'/Users/jianbao/projects/tao.com/mysite/apache/django.wsgi'.
[] Traceback (most recent call last):
[]   File "/Users/jianbao/projects/tao.com/mysite/apache/django.wsgi", line 
56, in <module>
[]     import MySQLdb
[]   File 
"/Users/jianbao/projects/tao.com/mysite/lib/python2.7/site-packages/MySQLdb/__init__.py",
 
line 19, in <module>
[]     import _mysql
[] ImportError: 
dlopen(/Users/jianbao/projects/tao.com/mysite/lib/python2.7/site-packages/_mysql.so,
 
2): Library not loaded: libmysqlclient.18.dylib
[]   Referenced from: 
/Users/jianbao/projects/tao.com/mysite/lib/python2.7/site-packages/_mysql.so
[]   Reason: image not found

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eXS-nCx7Ut4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to