osx - Installing MySQL-python raises compiler warnings after Mavericks

15
2013-12
  • cubsink

    I had many python modules installed before I upgraded Mavericks and were very disappointed when I noticed that they had been removed. I installed Mavericks, and I installed the command line tools.

    Then I went on trying to download and compile MySQL-python since I need it for my development. It raises compiler warnings during install and then just freezes.

    Here are the compiler warnings:

    Downloading/unpacking MySQL-python
      Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
      Running setup.py egg_info for package MySQL-python
        Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
        Extracting in /tmp/tmpYaLRd4
        Now working in /tmp/tmpYaLRd4/distribute-0.6.28
        Building a Distribute egg in /private/tmp/pip_build_root/MySQL-python
        /private/tmp/pip_build_root/MySQL-python/distribute-0.6.28-py2.7.egg
    
    Installing collected packages: MySQL-python
      Running setup.py install for MySQL-python
        building '_mysql' extension
        cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -arch x86_64 -arch i386 -pipe -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/local/Cellar/mysql/5.6.10/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        In file included from _mysql.c:44:
        /usr/local/Cellar/mysql/5.6.10/include/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
          #define SIZEOF_SIZE_T  SIZEOF_LONG
                  ^
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
        #        define SIZEOF_SIZE_T           8
                        ^
        In file included from _mysql.c:44:
        /usr/local/Cellar/mysql/5.6.10/include/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
        #define HAVE_WCSCOLL
                ^
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:906:9: note: previous definition is here
        #define HAVE_WCSCOLL 1
                ^
        _mysql.c:287:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        cmd_argc = PySequence_Size(cmd_args);
                                 ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:317:12: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        groupc = PySequence_Size(groups);
                               ~ ^~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:470:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                                int j, n2=PySequence_Size(fun);
                                       ~~ ^~~~~~~~~~~~~~~~~~~~
        _mysql.c:1105:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = mysql_real_escape_string(&(self->connection), out, in, size);
                            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:1107:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = mysql_escape_string(out, in, size);
                            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:1146:9: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                size = PyString_GET_SIZE(s);
                     ~ ^~~~~~~~~~~~~~~~~~~~
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:92:32: note: expanded from macro 'PyString_GET_SIZE'
        #define PyString_GET_SIZE(op)  Py_SIZE(op)
                                       ^~~~~~~~~~~
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:116:56: note: expanded from macro 'Py_SIZE'
        #define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
        _mysql.c:1156:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = mysql_real_escape_string(&(self->connection), out+1, in, size);
                            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:1158:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                        len = mysql_escape_string(out+1, in, size);
                            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        _mysql.c:1252:11: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                if ((n = PyObject_Length(o)) == -1) goto error;
                       ~ ^~~~~~~~~~~~~~~~~~
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:434:25: note: expanded from macro 'PyObject_Length'
        #define PyObject_Length PyObject_Size
                                ^
        _mysql.c:1444:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
                                len = strlen(buf);
                                    ~ ^~~~~~~~~~~
        _mysql.c:1446:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
                                len = strlen(buf);
                                    ~ ^~~~~~~~~~~
        _mysql.c:1482:11: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
                                        len = strlen(buf);
                                            ~ ^~~~~~~~~~~
        _mysql.c:1484:11: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
                                        len = strlen(buf);
                                            ~ ^~~~~~~~~~~
        _mysql.c:1567:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (how < 0 || how >= sizeof(row_converters)) {
                    ~~~ ^ ~
        16 warnings generated.
        In file included from _mysql.c:44:
        /usr/local/Cellar/mysql/5.6.10/include/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
          #define SIZEOF_SIZE_T  SIZEOF_LONG
                  ^
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:17: note: previous definition is here
        #        define SIZEOF_SIZE_T           4
                        ^
        In file included from _mysql.c:44:
        /usr/local/Cellar/mysql/5.6.10/include/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
        #define HAVE_WCSCOLL
                ^
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:906:9: note: previous definition is here
        #define HAVE_WCSCOLL 1
                ^
        In file included from _mysql.c:44:
        /usr/local/Cellar/mysql/5.6.10/include/my_config.h:659:9: warning: 'SIZEOF_TIME_T' macro redefined
        #define SIZEOF_TIME_T 8
                ^
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:57:17: note: previous definition is here
        #        define SIZEOF_TIME_T           4
                        ^
        _mysql.c:1567:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (how < 0 || how >= sizeof(row_converters)) {
                    ~~~ ^ ~
        4 warnings generated.
    

    Seems like it complains on a lot of variables already defined. But I don't know how to solve these problems since I don't really know what's going on. And I don't think trying to edit the source will give me any good answers.

    I have tried to use both pip and easy_install to install the extension. Both generate warnings and freezes. Please help me :)

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    linux - "No such file or directory" error while installing MySQL for Python
  • kritya

    I'm getting this error while installing MySQL for Python.

    running build 
    running build_py 
    copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb 
    running build_ext building '_mysql' extension gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2
    -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX 
    unable to execute gcc: 
    No such file or directory error: 
    command 'gcc' failed with exit status 1
    

    I issued this command:

    python setup.py install
    

    And I downloaded the library from here.

    EDIT

    After installing gcc it gives this :

        running install
    running bdist_egg
    running egg_info
    writing MySQL_python.egg-info/PKG-INFO
    writing top-level names to MySQL_python.egg-info/top_level.txt
    writing dependency_links to MySQL_python.egg-info/dependency_links.txt
    reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'GPL'
    writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-i686/egg
    running install_lib
    running build_py
    copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
    running build_ext
    building '_mysql' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX
    In file included from _mysql.c:29:
    pymemcompat.h:10:20: error: Python.h: No such file or directory
    _mysql.c:30:26: error: structmember.h: No such file or directory
    _mysql.c:36:23: error: my_config.h: No such file or directory
    _mysql.c:38:19: error: mysql.h: No such file or directory
    _mysql.c:39:26: error: mysqld_error.h: No such file or directory
    _mysql.c:40:20: error: errmsg.h: No such file or directory
    _mysql.c:62: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:64: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:72: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:75: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
    _mysql.c:85: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
    _mysql.c:88: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
    _mysql.c:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
    _mysql.c:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:227: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:318: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:359: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c:360: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c: In function ‘_mysql_ResultObject_Initialize’:
    _mysql.c:362: error: ‘NULL’ undeclared (first use in this function)
    _mysql.c:362: error: (Each undeclared identifier is reported only once
    _mysql.c:362: error: for each function it appears in.)
    _mysql.c:363: error: ‘MYSQL_RES’ undeclared (first use in this function)
    _mysql.c:363: error: ‘result’ undeclared (first use in this function)
    _mysql.c:363: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:363: warning: statement with no effect
    _mysql.c:364: warning: initialization from incompatible pointer type
    _mysql.c:366: error: ‘PyObject’ undeclared (first use in this function)
    _mysql.c:366: error: ‘conv’ undeclared (first use in this function)
    _mysql.c:366: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:366: warning: statement with no effect
    _mysql.c:368: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
    _mysql.c:368: error: ‘fields’ undeclared (first use in this function)
    _mysql.c:368: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:368: warning: statement with no effect
    _mysql.c:370: warning: implicit declaration of function ‘PyArg_ParseTupleAndKeywords’
    _mysql.c:370: error: ‘args’ undeclared (first use in this function)
    _mysql.c:370: error: ‘kwargs’ undeclared (first use in this function)
    _mysql.c:373: warning: implicit declaration of function ‘PyDict_New’
    _mysql.c:373: warning: statement with no effect
    _mysql.c:375: error: ‘_mysql_ResultObject’ has no member named ‘conn’
    _mysql.c:375: error: expected expression before ‘)’ token
    _mysql.c:375: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:375: warning: statement with no effect
    _mysql.c:376: warning: implicit declaration of function ‘Py_INCREF’
    _mysql.c:377: error: ‘_mysql_ResultObject’ has no member named ‘use’
    _mysql.c:377: warning: statement with no effect
    _mysql.c:378: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:378: warning: statement with no effect
    _mysql.c:380: warning: implicit declaration of function ‘mysql_use_result’
    _mysql.c:380: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:380: warning: statement with no effect
    _mysql.c:382: warning: implicit declaration of function ‘mysql_store_result’
    _mysql.c:382: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:382: warning: statement with no effect
    _mysql.c:383: error: ‘_mysql_ResultObject’ has no member named ‘result’
    _mysql.c:383: warning: statement with no effect
    _mysql.c:384: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:384: warning: statement with no effect
    _mysql.c:386: error: ‘_mysql_ResultObject’ has no member named ‘converter’
    _mysql.c:386: warning: implicit declaration of function ‘PyTuple_New’
    _mysql.c:386: warning: statement with no effect
    _mysql.c:389: warning: implicit declaration of function ‘mysql_num_fields’
    _mysql.c:390: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
    _mysql.c:390: warning: statement with no effect
    _mysql.c:391: error: ‘_mysql_ResultObject’ has no member named ‘converter’
    _mysql.c:392: warning: implicit declaration of function ‘mysql_fetch_fields’
    _mysql.c:392: warning: statement with no effect
    _mysql.c:394: error: ‘tmp’ undeclared (first use in this function)
    _mysql.c:394: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:394: error: ‘fun’ undeclared (first use in this function)
    _mysql.c:394: warning: left-hand operand of comma expression has no effect
    _mysql.c:394: warning: statement with no effect
    _mysql.c:395: warning: implicit declaration of function ‘PyInt_FromLong’
    _mysql.c:395: error: request for member ‘type’ in something not a structure or union
    _mysql.c:395: warning: statement with no effect
    _mysql.c:397: warning: implicit declaration of function ‘PyObject_GetItem’
    _mysql.c:397: warning: statement with no effect
    _mysql.c:398: warning: implicit declaration of function ‘Py_DECREF’
    _mysql.c:400: warning: implicit declaration of function ‘PyErr_Clear’
    _mysql.c:401: error: ‘Py_None’ undeclared (first use in this function)
    _mysql.c:401: warning: statement with no effect
    _mysql.c:404: warning: implicit declaration of function ‘PySequence_Check’
    _mysql.c:405: warning: implicit declaration of function ‘PySequence_Size’
    _mysql.c:406: error: ‘fun2’ undeclared (first use in this function)
    _mysql.c:406: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:406: warning: statement with no effect
    _mysql.c:408: error: ‘t’ undeclared (first use in this function)
    _mysql.c:408: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:408: warning: implicit declaration of function ‘PySequence_GetItem’
    _mysql.c:408: warning: statement with no effect
    _mysql.c:410: warning: implicit declaration of function ‘PyTuple_Check’
    _mysql.c:411: warning: implicit declaration of function ‘PyTuple_GET_SIZE’
    _mysql.c:413: error: ‘pmask’ undeclared (first use in this function)
    _mysql.c:413: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:413: warning: statement with no effect
    _mysql.c:414: warning: implicit declaration of function ‘PyTuple_GET_ITEM’
    _mysql.c:414: warning: statement with no effect
    _mysql.c:415: warning: statement with no effect
    _mysql.c:416: warning: implicit declaration of function ‘PyInt_Check’
    _mysql.c:417: warning: implicit declaration of function ‘PyInt_AS_LONG’
    _mysql.c:418: error: request for member ‘flags’ in something not a structure or union
    _mysql.c:418: error: invalid operands to binary & (have ‘long int’ and ‘char **’)
    _mysql.c:433: warning: statement with no effect
    _mysql.c:436: warning: statement with no effect
    _mysql.c:438: warning: implicit declaration of function ‘PyTuple_SET_ITEM’
    _mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
    _mysql.c: In function ‘_mysql_ResultObject_clear’:
    _mysql.c:462: warning: implicit declaration of function ‘Py_XDECREF’
    _mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
    _mysql.c:463: error: ‘_mysql_ResultObject’ has no member named ‘converter’
    _mysql.c:463: error: ‘NULL’ undeclared (first use in this function)
    _mysql.c:463: warning: statement with no effect
    _mysql.c:464: error: ‘_mysql_ResultObject’ has no member named ‘conn’
    _mysql.c:465: error: ‘_mysql_ResultObject’ has no member named ‘conn’
    _mysql.c:465: warning: statement with no effect
    _mysql.c: At top level:
    _mysql.c:472: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c:473: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
    _mysql.c:475: error: ‘MYSQL’ undeclared (first use in this function)
    _mysql.c:475: error: ‘conn’ undeclared (first use in this function)
    _mysql.c:475: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:475: error: ‘NULL’ undeclared (first use in this function)
    _mysql.c:475: warning: statement with no effect
    _mysql.c:476: error: ‘PyObject’ undeclared (first use in this function)
    _mysql.c:476: error: ‘conv’ undeclared (first use in this function)
    _mysql.c:476: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:476: warning: statement with no effect
    _mysql.c:477: error: ‘ssl’ undeclared (first use in this function)
    _mysql.c:477: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:477: warning: statement with no effect
    _mysql.c:482: warning: initialization from incompatible pointer type
    _mysql.c:482: warning: initialization from incompatible pointer type
    _mysql.c:482: warning: initialization from incompatible pointer type
    _mysql.c:483: warning: initialization from incompatible pointer type
    _mysql.c:483: warning: initialization from incompatible pointer type
    _mysql.c:493: error: initializer element is not constant
    _mysql.c:493: error: (near initialization for ‘kwlist[16]’)
    _mysql.c:496: warning: initialization from incompatible pointer type
    _mysql.c:497: warning: initialization from incompatible pointer type
    _mysql.c:498: warning: initialization from incompatible pointer type
    _mysql.c:500: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
    _mysql.c:500: warning: statement with no effect
    _mysql.c:501: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
    _mysql.c:501: warning: statement with no effect
    _mysql.c:503: error: ‘args’ undeclared (first use in this function)
    _mysql.c:503: error: ‘kwargs’ undeclared (first use in this function)
    _mysql.c:530: warning: implicit declaration of function ‘PyErr_SetString’
    _mysql.c:530: error: ‘_mysql_NotSupportedError’ undeclared (first use in this function)
    _mysql.c:536: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:536: warning: statement with no effect
    _mysql.c:537: warning: implicit declaration of function ‘mysql_init’
    _mysql.c:537: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:537: warning: statement with no effect
    _mysql.c:540: warning: implicit declaration of function ‘mysql_options’
    _mysql.c:540: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:540: error: ‘MYSQL_OPT_CONNECT_TIMEOUT’ undeclared (first use in this function)
    _mysql.c:544: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:544: error: ‘MYSQL_OPT_COMPRESS’ undeclared (first use in this function)
    _mysql.c:545: error: ‘CLIENT_COMPRESS’ undeclared (first use in this function)
    _mysql.c:545: error: invalid operands to binary | (have ‘unsigned int’ and ‘char **’)
    _mysql.c:545: warning: statement with no effect
    _mysql.c:548: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:548: error: ‘MYSQL_OPT_NAMED_PIPE’ undeclared (first use in this function)
    _mysql.c:549: warning: comparison of distinct pointer types lacks a cast
    _mysql.c:550: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:550: error: ‘MYSQL_INIT_COMMAND’ undeclared (first use in this function)
    _mysql.c:551: warning: comparison of distinct pointer types lacks a cast
    _mysql.c:552: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:552: error: ‘MYSQL_READ_DEFAULT_FILE’ undeclared (first use in this function)
    _mysql.c:553: warning: comparison of distinct pointer types lacks a cast
    _mysql.c:554: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:554: error: ‘MYSQL_READ_DEFAULT_GROUP’ undeclared (first use in this function)
    _mysql.c:557: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:557: error: ‘MYSQL_OPT_LOCAL_INFILE’ undeclared (first use in this function)
    _mysql.c:565: warning: implicit declaration of function ‘mysql_real_connect’
    _mysql.c:565: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:566: warning: statement with no effect
    _mysql.c:568: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:568: warning: statement with no effect
    _mysql.c:571: warning: implicit declaration of function ‘_mysql_Exception’
    _mysql.c:577: warning: statement with no effect
    _mysql.c:583: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
    _mysql.c:583: warning: statement with no effect
    _mysql.c:591: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
    _mysql.c:591: warning: statement with no effect
    _mysql.c: At top level:
    _mysql.c:649: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c: In function ‘_mysql_ConnectionObject_clear’:
    _mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
    _mysql.c:682: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
    _mysql.c:682: error: ‘NULL’ undeclared (first use in this function)
    _mysql.c:682: warning: statement with no effect
    _mysql.c: At top level:
    _mysql.c:689: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:717: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:733: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:751: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:770: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:796: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:818: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:850: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:935: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:951: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:969: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1004: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1035: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1037: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1067: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1097: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1131: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1163: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1199: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1223: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1248: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1273: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1312: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1351: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1356: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c:1359: error: expected declaration specifiers or ‘...’ before ‘_PYFUNC’
    _mysql.c: In function ‘_mysql__fetch_row’:
    _mysql.c:1362: error: ‘MYSQL_ROW’ undeclared (first use in this function)
    _mysql.c:1362: warning: statement with no effect
    _mysql.c:1362: error: expected ‘;’ before ‘row’
    _mysql.c:1365: error: ‘PyObject’ undeclared (first use in this function)
    _mysql.c:1365: error: ‘v’ undeclared (first use in this function)
    _mysql.c:1365: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:1365: warning: statement with no effect
    _mysql.c:1366: error: ‘_mysql_ResultObject’ has no member named ‘use’
    _mysql.c:1367: error: ‘row’ undeclared (first use in this function)
    _mysql.c:1367: warning: implicit declaration of function ‘mysql_fetch_row’
    _mysql.c:1367: error: ‘_mysql_ResultObject’ has no member named ‘result’
    _mysql.c:1367: warning: statement with no effect
    _mysql.c:1369: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:1369: warning: statement with no effect
    _mysql.c:1370: error: ‘_mysql_ResultObject’ has no member named ‘result’
    _mysql.c:1370: warning: statement with no effect
    _mysql.c:1371: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
    _mysql.c:1371: warning: statement with no effect
    _mysql.c:1373: warning: implicit declaration of function ‘mysql_errno’
    _mysql.c:1373: error: ‘_mysql_ResultObject’ has no member named ‘conn’
    _mysql.c:1373: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
    _mysql.c:1374: error: ‘_mysql_ResultObject’ has no member named ‘conn’
    _mysql.c:1378: warning: implicit declaration of function ‘_PyTuple_Resize’
    _mysql.c:1378: error: ‘r’ undeclared (first use in this function)
    _mysql.c:1381: warning: implicit declaration of function ‘convert_row’
    _mysql.c:1381: warning: statement with no effect
    _mysql.c: At top level:
    _mysql.c:1399: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1506: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1597: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1612: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1627: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1642: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1658: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1693: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1711: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1734: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1751: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1767: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1796: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1819: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1849: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1871: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1898: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1919: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1960: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:1980: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c: In function ‘_mysql_ConnectionObject_dealloc’:
    _mysql.c:2014: error: ‘PyObject’ undeclared (first use in this function)
    _mysql.c:2014: error: ‘o’ undeclared (first use in this function)
    _mysql.c:2014: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
    _mysql.c:2014: warning: statement with no effect
    _mysql.c:2017: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
    _mysql.c:2018: warning: implicit declaration of function ‘_mysql_ConnectionObject_close’
    _mysql.c:2018: error: ‘NULL’ undeclared (first use in this function)
    _mysql.c:2018: warning: statement with no effect
    _mysql.c:2021: warning: implicit declaration of function ‘PyMem_Free’
    _mysql.c: At top level:
    _mysql.c:2024: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2041: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2056: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2078: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c: In function ‘_mysql_ResultObject_dealloc’:
    _mysql.c:2100: warning: implicit declaration of function ‘mysql_free_result’
    _mysql.c:2100: error: ‘_mysql_ResultObject’ has no member named ‘result’
    _mysql.c: At top level:
    _mysql.c:2105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_methods’
    _mysql.c:2330: error: array type has incomplete element type
    _mysql.c:2331: error: ‘T_INT’ undeclared here (not in a function)
    _mysql.c:2331: warning: implicit declaration of function ‘offsetof’
    _mysql.c:2331: error: expected expression before ‘_mysql_ConnectionObject’
    _mysql.c:2331: error: ‘RO’ undeclared here (not in a function)
    _mysql.c:2338: error: ‘T_OBJECT’ undeclared here (not in a function)
    _mysql.c:2338: error: expected expression before ‘_mysql_ConnectionObject’
    _mysql.c:2345: error: ‘T_UINT’ undeclared here (not in a function)
    _mysql.c:2345: error: expected expression before ‘_mysql_ConnectionObject’
    _mysql.c:2352: error: expected expression before ‘_mysql_ConnectionObject’
    _mysql.c:2359: error: expected expression before ‘_mysql_ConnectionObject’
    _mysql.c:2366: error: ‘NULL’ undeclared here (not in a function)
    _mysql.c:2369: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_methods’
    _mysql.c:2421: error: array type has incomplete element type
    _mysql.c:2422: error: expected expression before ‘_mysql_ResultObject’
    _mysql.c:2432: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2460: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2490: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c: In function ‘_mysql_ConnectionObject_setattr’:
    _mysql.c:2492: error: ‘v’ undeclared (first use in this function)
    _mysql.c:2493: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
    _mysql.c:2498: warning: implicit declaration of function ‘PyMember_Set’
    _mysql.c: At top level:
    _mysql.c:2515: error: expected declaration specifiers or ‘...’ before ‘PyObject’
    _mysql.c: In function ‘_mysql_ResultObject_setattr’:
    _mysql.c:2517: error: ‘v’ undeclared (first use in this function)
    _mysql.c:2518: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
    _mysql.c: At top level:
    _mysql.c:2536: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
    _mysql.c:2620: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
    _mysql.c:2706: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
    _mysql.c:2778: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    _mysql.c:2810: warning: return type defaults to ‘int’
    _mysql.c: In function ‘DL_EXPORT’:
    _mysql.c:2810: error: expected declaration specifiers before ‘init_mysql’
    _mysql.c:2888: error: expected ‘{’ at end of input
    error: command 'gcc' failed with exit status 1
    

  • Related Answers
  • Mikko Ohtamaa
    pymemcompat.h:10:20: error: Python.h: No such file or directory
    

    You are missing Python development headers package (called python-dev on Debian, don't remember what it is on CentOS)

  • Mark S.

    unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1

    This is your problem right here you do not have gcc installed. Install gcc and try again