0

I'm trying to install MySQL on OSX 10.6 to work with Django.

MySQL seems to have installed correctly.

I'm attempting to install MySQLdb for Python I've tried using easy_install

$ python setup.py install

Which completes

But I'm getting the follow error:

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
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.6-intel/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/alanquigley/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Users/alanquigley/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so
  Reason: image not found
>>> 

Any ideas?

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Alan Quigley
  • 1,642
  • 2
  • 15
  • 19

1 Answers1

0

Check to make sure the mysql client library (the C client library) is properly installed. Look in /usr/include or /usr/local/include for for a folder called "mysql". Do the same for /usr/lib or /usr/local/lib.

Zhehao Mao
  • 1,789
  • 13
  • 13