SQLdb_MySQL-mysql tutorial for installing Python on Mac

Source: Internet
Author: User
SQLdb Python on Mac

Mac 10.9


Download the package from the internet

Sudo easy_install mysql-python

Decisive failure.


Download mysql-python-1.2.3.tar from the internet

In fact, there are 1.2.5 versions, but they are too new to use. it seems that there is no tar version currently, and only zip is available.


Decompress the package and use vim to open site. cfg.

There is a line # mysql_config =/usr/local/bin/mysql_config

Remove the preceding annotations and enter the actual installation directory based on the mysql installation directory on your computer. if you click next, it should be as follows.

Mysql_config =/usr/local/mysql/bin/mysql_config


Then install with GCC and execute

Python setup. py clean

Python setup. py build

Python setup. py install


However, the second error occurs.

The error is as follows:

    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future    error: command 'cc' failed with exit status 1

Then I checked SOF and found the solution:

export CFLAGS=-Qunused-argumentsexport CPPFLAGS=-Qunused-arguments
Then I installed it. after a long time, I wrote it down here. I hope you can avoid detours.


After installing CJSON, you must add-E to sudo.

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.