【发布时间】:2011-10-20 17:14:54
【问题描述】:
您好,我在尝试导入 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
【问题讨论】:
-
说你安装了错误的mysqldb架构,根据你的系统规格检查你下载的版本?
-
可能是 32/64 位问题。您可以执行“lipo -info /Users/christopherfarm/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so”并在其中编辑输出吗?
-
有关安装的更多信息,请参阅stackoverflow.com/questions/1448429/…
-
@cularis 这里是终端
ipo -info /Users/christopherfarm/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so Non-fat file: /Users/christopherfarm/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so is architecture: i386 -
@Mark 我试过像你说的那样使用macports,但现在遇到了以下问题stackoverflow.com/questions/6964292/…
标签: python mysql macos mysql-python