mac mysqldb"导入MySQLdb",但显示" ImportError"

时间:2016-09-30 07:56:09

标签: python mysql-python

mac 10.11osx和mysql5.5 python 2.7(系统)mysqldb1.2.5,但是当我执行"导入MySQLdb"时,它错了----------

Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/MySQL_python-1.2.4-py2.7-macosx-10.11-intel.egg/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.4-py2.7-macosx-10.11-intel.egg/_mysql.so, 2): no suitable image found.  Did find:
    /Library/Python/2.7/site-packages/MySQL_python-1.2.4-py2.7-macosx-10.11-intel.egg/_mysql.so: mach-o, but wrong architecture

有人可以告诉我为什么吗?

0 个答案:

没有答案