0

为什么mysql python没有运行?

sudo ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build
sudo ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install

安装好

用python输出:

import MySQLdb
/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.5-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.5-intel.egg/_mysql.pyc, but /Users/kal1sha/Downloads/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.5-intel/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.5-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/kal1sha/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-intel.egg-tmp/_mysql.so, 2): no suitable image found.  Did find:
    /Users/kal1sha/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-intel.egg-tmp/_mysql.so: mach-o, but wrong architecture
4

0 回答 0