我一直在尝试在MAC上安装Mysql和Python以及MySQLdb模块。我已经成功地做到了这一点。从命令行我导入MySQLdb时它工作正常。但是,我将Eclipse配置为指向我的Python27 intepreter,当我尝试从Eclipse导入MySQLdb时,我得到架构不匹配错误。这是确切的错误
ImportError:
dlopen(/Users/bhaskaar/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so,2): no suitable image found.
Did find: /Users/bhaskaar/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so: mach-o, but wrong architecture
在Pythonpath下的External Library选项卡中,我指向
/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-macosx-10.7-x86_64.egg/_mysql.so
以下是更多信息
$ file $(which python)
/usr/local/bin/python: Mach-O 64-bit executable x86_64
$ file $(which mysql)
/usr/local/bin/mysql: Mach-O 64-bit executable x86_64
你能帮我解决一下这个问题吗?对我来说,似乎Eclipse正在构建一个32位而不是64位,但我不确定。感谢