这几天我一直在为此苦苦挣扎。安装/卸载/重新开始。
我正在尝试使用 MAMP 让 python 与 mysql 一起工作,并遵循了许多教程,但似乎我一直在测试导入 MySQLdb 模块。
以下是我收到的错误。关于如何继续的任何建议?
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.5-intel.egg/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.5-intel.egg/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.5-intel.egg/_mysql.so
Reason: image not found