Mac上的Mysql和Python

时间:2012-02-29 16:56:32

标签: python mysql macos

我为python安装了Mysqldb,但是当我运行它时,我收到了这个错误:

/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-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.7-intel.egg/_mysql.pyc, but /Users/bb/Workspace/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.7-intel/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/bb/.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/bb/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so: mach-o, but wrong architecture

关于如何在MAC上使用Python运行MySQL的任何想法。我花了最近两天的时间来研究它

1 个答案:

答案 0 :(得分:0)

当我下载32位版本而不是64位版本时出现同样的错误,安装64位版本修复了它。