开发者

Problem setting up MySQL with python on OSX 10.6

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", "cr开发者_开发百科edits" 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜