Error installing mysqldb under Mac

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.