Error: command 'cc' failed with exit status 1 - installing MySQLdb on MAC

I am new to Mac and I am trying to install MySQLdb for Python on MAC, but after following the steps mentioned in http://www.tutorialspoint.com/python/python_database_access.htm , I got an error message after starting

$ python setup.py build 

Error:

 clang: warning: argument unused during compilation: '-mno-fused-madd' _mysql.c:44:10: fatal error: 'my_config.h' file not found #include "my_config.h" ^ 1 error generated. error: command 'cc' failed with exit status 1 

Note. My path is "mysql_config" - / Applications / MAMP / Library / bin / mysql_config What should I do?

+6
source share
2 answers

The problem is the unused arguments passed to the compiler. Try this before you run the build code:

 export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments 
+9
source

Try installing this on the terminal before executing:

 export CC='/usr/bin/gcc' export CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/opt/X11/include -arch i386 -arch x86_64' export LDFLAGS='-arch i386 -arch x86_64' export ARCHFLAGS='-arch i386 -arch x86_64' 

found it here: https://jamesfriend.com.au/installing-pygame-python-mac-os-108-mountain-lion

+2
source

All Articles