我最近升级到了 OSx Mountain Lion (10.8),不久之后又升级到了 10.8.1。我试图做一个“导入 MySQLdb”并遇到以下错误:
>>> import MySQLdb
/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.8-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.8-intel.egg/_mysql.pyc, but /Users/jlk/Software_Downloads/MySQL-python/MySQL-python-1.2.3 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MySQLdb/__init__.py", line 19, in <module>
import _mysql
File "build/bdist.macosx-10.8-intel/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.8-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/jlk/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.8-intel.egg-tmp/_mysql.so, 2): no suitable image found. Did find:
/Users/jlk/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.8-intel.egg-tmp/_mysql.so: mach-o, but wrong architecture
不太确定出了什么问题或如何解决。我已经用谷歌搜索了,但无法找到与 osx 10.8.1 相关的任何答案。它最后说它是“错误的架构”,但我知道我安装的是模块的 OSx 版本。我看到的唯一区别是它说它适用于 10.8,但这是该模块的最新版本。
以供参考:
操作系统:OSx Mountain Lion 10.8.1 Pyhon 版本:2.7.2
有任何想法吗?
问候,
杰夫