先在线python-mysql库 官方库地址 http://mysql-python.sourceforge.net/ 下载下来的包,进行解压 直接执行 python setup.py build 有时会遇到这样的问题: $ sudo python setup.py build building a Distribute egg in /Users/mc2/Downloads/MySQL-python-1.2.4b4 /Users/mc2/Downloads/MySQL-python-1.2.4b4/distribute-0.6.28-py2.7.egg s More