WSGI: _mysql.so Image not found
Environment: MacBook Pro, OSX 10.6, Python 2.6.1 64 bit, MySQL 5.X 64 bit
I am having problems installing MySQLdb for use with Django. After installing everything I am able to open the python interpreter and execute:
import MySQLdb
This works fine. I am also able to create and run django apps and host them using the development server:
./manage.py runserver
But I am now trying to host this django app in my local apache. So I installed and configured mod_wsgi and added a virtual host to httpd.conf setting the location of my *.wsgi script. From that script I am able to define the application function en return a simple Hello World string.
But when I try to run:
import MySQLdb
inside a try block in my *.wsgi script, the caught exception says the following:
dlopen(/Library/Python/2.6/site-packages/_mysql.so, 2): Library not loaded:
libmysqlclient.18.dylib Referenced from: /Library/Python/2.6/site-packages/_mysql.so
Reason: image not found
So, simply put, the problem is that my MySQLdb adapter works when using it in the python interpreter and django development server, but not thro开发者_运维问答ugh Apache and mod_wsgi.
Any suggestions?
精彩评论