Tuesday, April 24, 2012

MySQLdb not running on Mac 10.7

I am trying to install MySQL-Python (MySQLdb) locally on my Mac and I am having trouble. I have been working on this for HOURS and I continue to get this error:



>>> import MySQLdb
/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.pyc, but /Users/dp/Code/MySQL-python-1.2.3 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MySQLdb/__init__.py", line 19, in <module>
import _mysql
File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/dp/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/dp/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so
Reason: image not found
>>>


I am trying to set up a python 2.7/Django/MySQL development environment and keep running into this problem. I have a feeling this could a problem with my .bash_profiles PATH so I am also including that below:



export PATH="/usr/local/mysql/bin:$PATH"


Thank you!!!



dp





No comments:

Post a Comment