嗨,我在尝试导入MySQLdb时出现以下错误。有人知道问题是什么吗?(我在mac上)

>>> 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/christopherfarm/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): no suitable image found.  Did find:
    /Users/christopherfarm/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so: mach-o, but wrong architecture

最佳答案

您必须安装为您的体系结构构建的egg,或者从源代码(即.zip或.tar.gz)安装。

关于python - 导入MySQLdb错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6954213/

10-13 02:57