I have MYSQL & MYSQLdb installed with Python 2.6 & Django 1.2.3. I can open & log on to mysql no problem but it’s not interfacing with python when I check to see if it’s working properly in the python interpreter. This is the error msg I am getting when I invoke it in the interpreter….
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/_mysql.so, 2): Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient_r.15.dylib
Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/_mysql.so
Reason: image not found
Looks like you are using a
MacPortsPython installation on MacOS X. If you useMacPortsproperly to upgrade, you should not run into problems like that. First, make sure your installation is up-to-date:Then, if you still have problems, make sure you don’t have a file permission problem somewhere. It should look something like this:
Also make sure you don’t have an architecture mismatch:
And, of course, make sure you are really using the
MacPortsPython: