我已经尝试过我能在网上找到的所有内容。我已经使用dmg安装了mysql,我尝试安装mysql-python(我觉得有用)。但是当我在python解释器“import MySQLdb”中运行时,我仍然会收到错误:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/matthew/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/matthew/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
Reason: image not found
我无法弄清楚问题。关于如何追踪这一点的想法?
答案 0 :(得分:10)
我刚刚在我的系统上安装了这个,这些是我为使其工作所采取的步骤:
最后你只是尝试在python中导入MySQLdb。希望对你也有用。
Ignas