MAC OS 10.6.8上的MySQLdb

时间:2013-09-18 20:43:35

标签: python django mysql-python

>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so: mach-o, but wrong architecture

我在MAC 10.6.8上安装MySQLdb时遇到了很多麻烦我读了很多关于如何解决但没有成功的指南。

1 个答案:

答案 0 :(得分:0)

输出是什么:

# which python

# which pip

如果安装了pip,请尝试:

# pip install mysqldb