我花了几个小时试图在Mac OS X Snow Leopard上安装MySQLdb(Python库)。我正在使用SO的these instructions。我不断收到一个错误,所以我尝试过使用MacPorts(作为对该问题的答案之一的建议),但我仍然得到相同的错误。任何人都可以帮忙吗?在Mac OS X上安装MySQLdb
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/josephmornin/.python-egg-cache/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): no suitable image found.
Did find:
/Users/josephmornin/.python-egg-cache/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so: mach-o, but wrong architecture
试过ActivePython的? http://code.activestate.com/pypm/mysql-python/ – 2011-04-04 17:51:25
[如何在Mac OS X上安装MySQLdb(Python数据访问库到MySQL)的可能的重复?](http://stackoverflow.com/questions/ 1448429/how-to-install-mysqldb-python-data-access-library -to-mysql-on-mac-os -x) – Mark 2011-09-03 10:51:36