Last Login:sun 10 21:07:51On Ttys001sandymatomacbook-pro:mysql-python-1.2. 4b4 sandy$ sudo python setup.py buildrunning buildrunning build_pycopying mysqldb/release.py-build/lib.macosx-10.6-intel-2.7/mysqldbrunning Build_exttraceback (most recent): File"setup.py", line 21,inch<module>Setup (**metadata) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/core.py", Line 152,inchSetup dist.run_commands () File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 953,inchrun_commands self.run_command (cmd) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 972,inchRun_command cmd_obj.run () File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/command/build.py", line 127,inchrun Self.run_command (cmd_name) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/cmd.py", line 326,inchrun_command self.distribution.run_command (command) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 972,inchRun_command cmd_obj.run () File"build/bdist.macosx-10.6-intel/egg/setuptools/command/build_ext.py", line 46,inchRun File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 307,inchrun Customize_compiler (self.compiler) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/sysconfig.py", Line 170,inchCustomize_compiler _osx_support.customize_compiler (_config_vars) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/_osx_support.py", line 418,inchCustomize_compiler _find_appropriate_compiler (_config_vars) File"/library/frameworks/python.framework/versions/2.7/lib/python2.7/_osx_support.py", line 191,inch_find_appropriate_compiler"cannot locate working compiler") Systemerror:cannot Locate working Compilersandymatomacbook-PRO:MYSQL-PYTHON-1.2.4B4 sandy$
Install MySQLdb:
MySQL for Python http://sourceforge.net/projects/mysql-python/
Tar zxvf Mysql-python
CD MYSQL-PYTHON-1.2.4B4
Python setup.py install reported the above error
Reason: The computer does not have GCC installed
GCC is the C language compiler, python-mysql a part of the code implementation is C, to be compiled with GCC
To install GCC:
Https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg
Error installing mysqldb under Mac