9

This error broke my python-mysql installation on Mac 10.7.5. Here are the steps

  1. The installed python is 2.7.1, mysql is 64 bit for 5.6.11.
  2. The being installed python-mysql is 1.2.4, also tried 1.2.3
  3. Configurations for the installation

    1) sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
    2) Edit the setup_posix.py and change the following mysql_config.path = "mysql_config" to mysql_config.path = "/usr/local/mysql/bin/mysql_config" 
    3) sudo python setup.py build
    

Here is the stacktrace for build

running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-intel-2.7/_mysql.o -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
cc1: error: unrecognized command line option "-Wno-null-conversion"
error: command 'llvm-gcc-4.2' failed with exit status 1

Welcome your suggestions and ideas. Thanks.

asked Apr 21, 2013 at 2:55

2 Answers 2

26

Try to Remove cflags -Wno-null-conversion -Wno-unused-private-field in

/usr/local/mysql/bin/mysql_config.

like:

cflags="-I$pkgincludedir -Wall -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!
Hugo Dozois
8,49812 gold badges56 silver badges59 bronze badges
answered Apr 21, 2013 at 15:15
Sign up to request clarification or add additional context in comments.

2 Comments

Removed them, the installation succeeds. A new error thrown, "Python mysqldb: Library not loaded: libmysqlclient.18.dylib" resolved with this thread stackoverflow.com/questions/6383310/…
This solved my problem as well trying to get mysql2 gem installed. I looked in gems/mysql2-0.3.11/ext/mysql/mkmf.log and found the same error. Removing -Wno-null-conversion and -Wno-unused-private-field made it work w/o issues. Now I just wish I knew what they did... Also, since I used homebrew to install mysql, my mysql_config was in: /usr/local/Cellar/mysql/5.6.12/bin/mysql_config
0

Wow, I've been spending a couple of hours on thistrying to 'pip install MySQL-python'. I have been re-installing Xcode 4.6.3, the Xcode command line tools seperatly (on Mac OS X 10.7.5), and installing Kenneth Reitz' stuff (https://github.com/kennethreitz/osx-gcc-installer) to no avail while I was ...

Altering the cflags options finally helped!

Thanks!

answered Sep 16, 2013 at 9:50

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.