您好,我在尝试导入 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/