我已经为 python 安装了 MySQL,但不太确定它是否有效。我继续使用python并输入:
import MySQLdb
显示的错误是:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.9- intel.egg/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7- macosx-10.9-intel.egg/_mysql.so, 2): no suitable image found. Did find:
/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.9- intel.egg/_mysql.so: mach-o, but wrong architecture
我不知道实际的错误是什么,更不用说如何修复它了。您是否建议我重新安装它,如果是,我该怎么办?
我基本上只需要模块工作。
谢谢你的帮助!