在CentOs中安装mysql-python返回错误 [英] Install mysql-python return error in CentOs

查看:166
本文介绍了在CentOs中安装mysql-python返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在CentOs上运行一个django项目。我试图通过easy_install和pip安装mysql-python,但是我有两个错误。我问了这个问题,发现了一些建议,但没有一个帮助我。



错误是:

  _mysql.c:29:20:错误:Python.h:没有这样的文件或目录
_mysql.c:40:26:错误:structmember.h:没有这样的文件或目录
_mysql.c:74:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:75:error: '*'标记之前的'=',',',';','asm'或'__attribute__'
_mysql.c:76:error:expected'=',',',';' '*'标记之前的asm'或'__attribute__'
_mysql.c:77:error:expected'=',',',';','asm'或'__attribute__' $ b _mysql.c:78:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:79:error:expected'= ',',',';'asm'或'__attribute__'之前'*'标记
_mysql.c:80:error:expected'=','在'*'标记之前的',',',','或'__attribute__'
_mysql.c:81:error:expected'=',',',';','asm'或'__attribute__ ''''''''$'$ b $ m $ c $ 82
_mysql.c:82:error:expected'=',',',';','asm'或'__attribute__' :83:error:expected'=',',',';','asm'或'__attribute__'before'*'token
_mysql.c:84:error:expected'=',' ,',','asm'或'__attribute__'在'*'标记之前
_mysql.c:87:error:expected specifier-qualifier-list before'PyObject_HEAD'
_mysql.c:97:error在'_mysql_ConnectionObject_Type'之前'expected'=',',',';','asm'或'__attribute__'
_mysql.c:100:error:'PyObject_HEAD'之前的specifier-qualifier-list'$ b $ '_mysql_ResultObject_Type'
_mysql.c:127:error:exp()_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _在'*'标记之前ected'=',',',';','asm'或'__attribute__'
_mysql.c:261:error:expected'=',',',';' '*'标记前的'asm'或'__attribute__'
_mysql.c:361:error:expected'=',',',';','asm'或'__attribute__' b $ b _mysql.c:379:'*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:402:错误:预期声明PyObject前的说明符或'...'
_mysql.c:403:错误:预期声明说明符或'...'之前的'PyObject'
_mysql.c:在函数'_mysql_ResultObject_Initialize'中:
_mysql.c:405:error:'NULL'undeclared(在此函数中首次使用)
_mysql.c:405:错误:(每个未声明的标识符仅报告一次
_mysql.c :405:错误:对于其中出现的每个函数。)
_mysql.c:407:警告:不兼容指针类型的初始化
_mysql.c:409:错误: PyObject'undeclared(在此函数中首次使用)
_mysql.c:409:错误:'conv'undeclared(在此函数中首次使用)
_mysql.c:409:错误:无效操作数到二进制* (具有'char **'和'char **')
_mysql.c:409:warning:没有影响的语句
_mysql.c:413:warning:隐式声明函数'PyArg_ParseTupleAndKeywords'
_mysql.c:413:错误:'args'undeclared(在此函数中首次使用)
_mysql.c:413:错误:'kwargs'undeclared(在此函数中首次使用)
_mysql .c:417:warning:隐式声明函数'PyDict_New'
_mysql.c:421:warning:隐式声明函数'py_INCREF'
_mysql.c:423:错误:'_mysql_ResultObject'没有成员名为'conn'
_mysql.c:423:错误:预期表达式之前')'标记
_mysql.c:423:错误:无效操作数到二进制*(有'char **'和' char **')
_mysql.c:423:warning:无效的语句
_mysql.c:425:错误:'_mysql_ResultObject'没有名为'use'的成员
_mysql.c:425:warning:没有影响的语句
_mysql.c:426:错误:'Py_BEGIN_ALLOW_THREADS'未声明(在此函数中首次使用)
_mysql.c:426:warning:没有影响的语句
_mysql.c:428:错误:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:428:warning :从不兼容的指针类型
/usr/include/mysql/mysql.h:401传递'mysql_use_result'的参数1:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1 ]'
_mysql.c:430:错误:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:430:warning:从不兼容的指针类型$ b $传递'mysql_store_result'的参数1 b /usr/include/mysql/mysql.h:400:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql.c:431:error:' _mysql_ResultObject'没有成员名为'result'
_mysql.c:431:wa rning:没有影响的语句
_mysql.c:432:错误:'Py_END_ALLOW_THREADS'未声明(在此函数中首次使用)
_mysql.c:432:warning:无效的语句
_mysql .c:434:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:434:warning:从不兼容的指针类型传递'mysql_field_count'的参数1
/ usr / include / mysql /mysql.h:368:note:expected'struct MYSQL *',但参数类型为'char *(*)[1]'
_mysql.c:435:warning:隐式声明函数'_mysql_Exception'
_mysql.c:438:error:'_mysql_ResultObject'没有名为'converter'的成员
_mysql.c:438:warning:隐式声明函数'PyTuple_New'
_mysql.c:438:警告:不起作用的语句
_mysql.c:439:warning:隐式声明函数'Py_DECREF'
_mysql.c:443:错误:'_mysql_ResultObject'没有名为'nfields'的成员
_mysql.c:443:warning:语句wi没有效果
_mysql.c:444:error:'_mysql_ResultObject'没有名为'converter'的成员
_mysql.c:450:error:'tmp'undeclared(在此函数中首次使用)
_mysql.c:450:错误:无效的操作数到二进制*(有'char **'和'char **')
_mysql.c:450:错误:'fun'未声明(首先在此使用函数)
_mysql.c:450:警告:逗号表达式的左侧操作数没有影响
_mysql.c:450:warning:没有影响的语句
_mysql.c:451:警告:隐式声明函数'PyInt_FromLong'
_mysql.c:451:warning:语句不起作用
_mysql.c:456:warning:隐式声明函数'PyObject_GetItem'
_mysql。 c:456:warning:没有影响的语句
_mysql.c:459:warning:隐式声明函数'PyErr_Occurred'
_mysql.c:460:warning:隐式声明函数'PyErr_ExceptionMatches'
_mysql.c:460:错误:'PyExc_KeyError'未声明(首先在此使用函数)
_mysql.c:464:warning:隐式声明函数'PyErr_Clear'
_mysql.c:466:error:'Py_None'undeclared(在此函数中首次使用)
_mysql。 c:466:warning:无效的语句
_mysql.c:469:warning:隐式声明函数'PySequence_Check'
_mysql.c:470:warning:隐式声明函数'PySequence_Size'
_mysql.c:471:error:'fun2'undeclared(在此函数中首次使用)
_mysql.c:471:错误:无效操作数到二进制*(有'char **'和'char ** ')
_mysql.c:471:warning:无效的语句
_mysql.c:473:错误:'t'未声明(在此函数中首次使用)
_mysql.c:473 :错误:对二进制的无效操作数*(具有'char **'和'char **')
_mysql.c:473:warning:隐式声明函数'PySequence_GetItem'
_mysql.c:473 :warning:无效的语句
_mysql.c:479:warning:隐式声明函数'PyTuple_Check
_mysql.c:479:warning:隐式声明函数'PyTuple_GET_SIZE'
_mysql.c:481:error:'pmask'undeclared(在此函数中首次使用)
_mysql.c: 481:错误:无效操作数到二进制*(有'char **'和'char **')
_mysql.c:481:warning:没有影响的语句
_mysql.c:482:warning :隐式声明函数'PyTuple_GET_ITEM'
_mysql.c:482:warning:不起作用的语句
_mysql.c:483:warning:没有影响的语句
_mysql.c:484:警告:隐式声明函数'PyInt_Check'
_mysql.c:485:warning:隐式声明函数'PyInt_AS_LONG'
_mysql.c:495:warning:没有影响的语句
_mysql。 c:504:warning:没有影响的语句
_mysql.c:507:warning:没有影响的语句
_mysql.c:509:warning:隐式声明函数'PyTuple_SET_ITEM'
_mysql .c:509:error:'_mysql_ResultObject'没有名为'converter'的成员
_my sql.c:在函数'_mysql_ResultObject_clear'中:
_mysql.c:535:warning:隐式声明函数'Py_XDECREF'
_mysql.c:535:错误:'_mysql_ResultObject'没有成员名为'转换器'
_mysql.c:536:error:'_mysql_ResultObject'没有名为'converter'的成员
_mysql.c:536:错误:'NULL'未声明(在此函数中首次使用)
_mysql.c:536:warning:没有效果的语句
_mysql.c:537:error:'_mysql_ResultObject'没有成员名为'conn'
_mysql.c:538:error:'_mysql_ResultObject'has没有成员名为'conn'
_mysql.c:538:warning:语句没有影响
_mysql.c:在顶层:
_mysql.c:545:错误:期望的声明说明符或'...'之前'PyObject'
_mysql.c:546:错误:预期声明说明符或'...'之前的'PyObject'
_mysql.c:在函数'_mysql_ConnectionObject_Initialize':
_mysql.c:548:error:'NULL'undeclared(first use in
_mysql.c:548:warning:初始化不兼容的指针类型
_mysql.c:549:错误:'PyObject'未声明(在此函数中首次使用)
_mysql.c :549:error:'conv'undeclared(在此函数中首次使用)
_mysql.c:549:错误:对二进制的无效操作数*(有'char **'和'char **')
_mysql.c:549:warning:无效的语句
_mysql.c:550:错误:'ssl'undeclared(在此函数中首次使用)
_mysql.c:550:错误:无效的操作数到二进制*(有'char **'和'char **')
_mysql.c:550:warning:没有影响的语句
_mysql.c:552:warning:从不兼容的指针类型初始化
_mysql.c:552:warning:从不兼容的指针类型初始化
_mysql.c:552:警告:从不兼容的指针类型初始化
_mysql.c:553:警告:从不兼容的指针初始化键入
_mysql.c:553:warning:从不兼容的指针类型初始化
_mysql。 c:555:warning:从不兼容的指针类型初始化
_mysql.c:555:警告:从不兼容的指针类型初始化
_mysql.c:555:警告:从不兼容的指针类型初始化
_mysql .c:556:warning:从不兼容的指针类型初始化
_mysql.c:556:warning:从不兼容的指针类型初始化
_mysql.c:569:error:initializer元素不是常量
_mysql.c:569:错误:(初始化为'kwlist [17]')
_mysql.c:575:警告:从不兼容的指针类型初始化
_mysql.c:576:warning:不兼容的指针类型
_mysql.c:577:警告:初始化不兼容的指针类型
_mysql.c:579:错误:'_mysql_ConnectionObject'没有成员名为'转换器'
_mysql.c: 579:warning:没有效果的语句
_mysql.c:580:error:'_mysql_ConnectionObject'没有名为'open'的成员
_mysql.c:580:warning:没有影响的语句
_mysql.c:583:error:'args'undeclared(在此函数中首次使用)
_mysql.c:583:error:'kwargs'undeclared(在此函数中首次使用)
_mysql.c: 616:error:'value'undeclared(在此函数中首次使用)
_mysql.c:616:错误:对二进制的无效操作数*(有'char **'和'char **')
_mysql.c:616:warning:没有影响的语句
_mysql.c:617:warning:隐式声明函数'PyMapping_GetItemString'
_mysql.c:617:warning:没有影响的语句
_mysql.c:617:warning:隐式声明函数'PyString_AsString'
_mysql.c:617:warning:赋值使整数的指针没有转换
_mysql.c:618:warning:statement with没有影响
_mysql.c:618:warning:赋值使整数的指针没有转换
_mysql.c:619:warning:没有影响的语句
_mysql.c:619:warning:赋值使整数指针没有转换
_mysql.c:620:warning:statement with no效果
_mysql.c:620:warning:赋值使整数的指针没有转换
_mysql.c:621:warning:没有影响的语句
_mysql.c:621:warning:assignment使整数的指针没有转换
_mysql.c:629:错误:'Py_BEGIN_ALLOW_THREADS'未声明(在此函数中首次使用)
_mysql.c:629:warning:不起作用的语句
_mysql.c:630:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:630:warning:从不兼容的指针类型传递'mysql_init'的参数1
/ usr / include / mysql / mysql.h:380:note:expected'struct MYSQL *',但参数类型为'char *(*)[1]'
_mysql.c:633:error:'_mysql_ConnectionObject' 'connection'
_mysql.c:634:warning:从不兼容的指针类型传递'mysql_options'的参数1
/usr/include/mysql/mysql.h:445:note:expected'struct MYSQL * '但是参数的类型是'char *(*)[1]'
_mysq lc:639:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:640:warning:从不兼容的指针类型传递'mysql_options'的参数1
/ usr / include / mysql / mysql.h:445:note:expected'struct MYSQL *',但参数类型为'char *(*)[1]'
_mysql.c:644:error:'_mysql_ConnectionObject'没有成员名为'connection '
_mysql.c:644:warning:从不兼容的指针类型
/usr/include/mysql/mysql.h:445传递'mysql_options'的参数1:note:expected'struct MYSQL *'参数的类型为'char *(*)[1]'
_mysql.c:648:error:'_mysql_ConnectionObject'没有成员名为'connection'
_mysql.c:648:warning: 1的mysql_options来自不兼容的指针类型
/usr/include/mysql/mysql.h:445:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql.c:649:warning:不同指针类型的比较缺少一个转换
_mysql.c:650:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:650:warning:从不兼容的指针类型传递'mysql_options'的参数1
/ usr / include / mysql / mysql.h:445:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql.c:651:warning:指针类型缺少一个演员
_mysql.c:652:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:652:warning:从不兼容的指针类型传递'mysql_options'的参数1
/usr/include/mysql/mysql.h:445:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql.c:653:警告:不同的指针类型的比较缺少一个演员
_mysql.c:654:错误:'_mysql_ConnectionObject'没有成员名为'连接'
_mysql.c:654:warning:传递参数1的'mysql_options '从不兼容的指针类型
/ usr / include / mysql / mys ql.h:445:note:expected'struct MYSQL *',但参数类型为'char *(*)[1]'
_mysql.c:657:error:'_mysql_ConnectionObject'没有成员名为'connection '
_mysql.c:657:warning:从不兼容的指针类型
/usr/include/mysql/mysql.h:445传递'mysql_options'的参数1:note:expected'struct MYSQL *'参数的类型为'char *(*)[1]'
_mysql.c:661:error:'_mysql_ConnectionObject'没有成员名为'connection'
_mysql.c:662:warning: 1的mysql_ssl_set来自不兼容的指针类型
/usr/include/mysql/mysql.h:381:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql.c:665:error:'_mysql_ConnectionObject'没有名为'connection'的成员
_mysql.c:666:warning:将不正确的指针类型'mysql_real_connect'的参数1传递给
/ usr /include/mysql/mysql.h:387:注意:expect'struct MYSQL *'但是参数是的类型'char *(*)[1]'
_mysql.c:668:错误:'Py_END_ALLOW_THREADS'未声明(在此函数中首次使用)
_mysql.c:668:warning:效果
_mysql.c:677:warning:无效的语句
_mysql.c:683:错误:'_mysql_ConnectionObject'没有名为'converter'的成员
_mysql.c:683:warning :没有影响的语句
_mysql.c:691:error:'_mysql_ConnectionObject'没有名为'open'的成员
_mysql.c:691:warning:没有影响的语句
_mysql.c :在顶级:
_mysql.c:749:错误:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:在函数'_mysql_ConnectionObject_clear':
_mysql.c:781:错误:'_mysql_ConnectionObject'没有成员名为'转换器'
_mysql.c:782:错误:'_mysql_ConnectionObject'没有成员名为'转换器'
_mysql.c:782:error:'NULL'undeclared(在此函数中首次使用)
_mysql.c:782:警告:不起作用的语句
_mysql.c:顶级:
_mysql.c:789:error:expected'=',',',';','asm'或'__attribute__'之前的'*'标记
_mysql.c:817:错误:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c: 833:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:851:error:expected'=',',' '''''''''''''标记之前
_mysql.c:870:error:expected'=',',',';','asm'或'__attribute__' *'token
_mysql.c:896:错误:expected'=',',',';','asm'或'__attribute__'之前'*'标记
_mysql.c:918: '*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:950:error:expected'=',',','; ','asm'或'__attribute__'之前的'*'令牌
_my sql.c:976:error:expected'=',',',';','asm'或'__attribute__'之前'*'标记
_mysql.c:1003:error:expected'=' '''''''''''''''''''''
_mysql.c:1022:error:expected'=',',',';','asm'或'在'*'标记之前的__attribute__'
_mysql.c:1039:'*'标记之前的错误:expected'=',',',';'asm'或'__attribute__'
_mysql。 c:1055:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1077:error:expected'=',' ''''''''或'__attribute__'在'*'标记之前
_mysql.c:1124:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1167:'*'标记之前的错误:expected'=',',',';','as_'或'__attribute__'
_mysql.c: 1169:error:expected'=',',',';','asm'或'__attribute__'之前的'*'标记
_mysql.c:1203:error:expected'=',',',';','asm'或'__attribute__' _mysql.c:1233:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1267:error:expected'=' ''''''''''''''''''''''
_mysql.c:1299:error:expected'=',',',';','asm'或'在'*'标记之前的__attribute__'
_mysql.c:1335:错误:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql。 c:1359:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1389:error:expected'=',' '''''''''或'__attribute__'之前'*'标记
_mysql.c:1414:error:expected'=',',',';','asm'或'__attribute__'之前'*'标记
_mysql.c:1453: '*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:1492:error:expected'=',',','; ','asm'或'__attribute__'之前的'*'标记
_mysql.c:1497:错误:预期声明说明符或'...'之前'PyObject'
_mysql.c:1500:错误:'_PYFUNC'之前的预期声明说明符或'...'
_mysql.c:在函数'_mysql__fetch_row'中:
_mysql.c:1506:error:'PyObject'未声明(在此函数中首先使用)
_mysql.c:1506:error:'v'undeclared(在此函数中首次使用)
_mysql.c:1506:错误:无效操作数到二进制*(有'char **'和' char **')
_mysql.c:1506:warning:没有影响的语句
_mysql.c:1507:error:'_mysql_ResultObject'没有名为'use'的成员
_mysql.c :1508:error:'_mysql_ResultObject'没有成员名为'result'
_mysql.c:1508:warning:传递参数1的'mysql_fetch_row'从不兼容的指针类型
/usr/include/mysql/mysql.h:454:note:expected'struct MYSQL_RES *',但参数的类型为'char **'
_mysql.c:1510:error :'Py_BEGIN_ALLOW_THREADS'未声明(在此函数中首次使用)
_mysql.c:1510:warning:无效的语句
_mysql.c:1511:error:'_mysql_ResultObject'没有名为result的成员
_mysql.c:1511:warning:从不兼容的指针类型
/usr/include/mysql/mysql.h:454传递'mysql_fetch_row'的参数1:note:expected'struct MYSQL_RES *'but argument是'char **'类型
_mysql.c:1512:错误:'Py_END_ALLOW_THREADS'未声明(首先在此函数中使用)
_mysql.c:1512:warning:没有影响的语句
_mysql.c:1514:error:'_mysql_ResultObject'没有成员名为'conn'
_mysql.c:1514:error:'_mysql_ConnectionObject'没有成员名为'connection'
_mysql.c:1514 :warning:传递'mysql_errno'的参数1 m不兼容的指针类型
/usr/include/mysql/mysql.h:371:note:expected'struct MYSQL *',但参数的类型为'char *(*)[1]'
_mysql。 c:1515:error:'_mysql_ResultObject'没有名为'conn'的成员
_mysql.c:1519:warning:隐式声明函数'_PyTuple_Resize'
_mysql.c:1519:error:'r'未声明(在此函数中首次使用)
_mysql.c:1522:warning:隐式声明函数'convert_row'
_mysql.c:1522:warning:不起作用的语句
_mysql.c :在顶级:
_mysql.c:1540:错误:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c: 1619:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1647:error:expected'=',',' '*'或'__attribute__'在'*'标记之前
_mysql.c:1673:error:expected'=',',',';','asm'或'__attribute__'前缀'*'标记
_mysql.c:1713:'*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c: 1755:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1774:error:expected'=',',' '*'标记之前的';','asm'或'__attribute__'
_mysql.c:1793:error:expected'=',',',';','asm'或'__attribute__' *'token
_mysql.c:1808:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:1828: '*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:1867:error:expected'=',',','; ''''''''''''之前'$'
_mysql.c:1885:'*'之前的错误:expected'=',',',';','asm'或'__attribute__'令牌
_mysql.c:1908:error:expected'=', '''''''''''''''''''''
_mysql.c:1925:error:expected'=',',',';','asm'或'在'*'标记之前的__attribute__'
_mysql.c:1941:'*'标记之前的错误:expected'=',',',';'asm'或'__attribute__'
_mysql。 c:1970:error:expected'=',',',';','asm'或'__attribute__'before'*'token
_mysql.c:1993:error:expected'=',' ''''''''''''''''''
_mysql.c:2023:error:expected'=',',',';','asm'或'__attribute__'之前'*'标记
_mysql.c:2045:错误:expected'=',',',';','asm'或'__attribute__'之前'*'标记
_mysql.c: 2072:error:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:2098:error:expected'=',',' ';','asm'或'__attribute__'之前'*令牌
_mysql.c:2139:'*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:2159:error: '*'标记前的'=',',',';','asm'或'__attribute__'
_mysql.c:在函数'_mysql_ConnectionObject_dealloc'中:
_mysql.c:2193:error :'PyObject'undeclared(在此函数中首次使用)
_mysql.c:2193:错误:'o'undeclared(在此函数中首次使用)
_mysql.c:2193:错误:无效操作数二进制*(有'char **'和'char **')
_mysql.c:2193:warning:没有影响的语句
_mysql.c:2196:error:'_mysql_ConnectionObject'没有成员命名为'open'
_mysql.c:2197:warning:隐式声明函数'_mysql_ConnectionObject_close'
_mysql.c:2197:错误:'NULL'未声明(首先在此函数中使用)
_mysql.c:2197:warning:语句不影响
_mysql.c:2200:warning:隐式声明函数'PyM em_Free'
_mysql.c:在顶级:
_mysql.c:2203:error'expected'=',',',';','asm'或'__attribute__'令牌
_mysql.c:2224:错误:expected'=',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:2239:error: '*'标记前的'=',',',';','asm'或'__attribute__'
_mysql.c:2261:error:expected'=',',',';' '*'标记之前的'asm'或'__attribute__'
_mysql.c:在函数'_mysql_ResultObject_dealloc'中:
_mysql.c:2283:错误:'_mysql_ResultObject'没有名为result的成员
_mysql.c:2283:warning:从不兼容的指针类型传递'mysql_free_result'的参数1
/usr/include/mysql/mysql.h:447:note:expected'struct MYSQL_RES *',但参数是键入'char **'
_mysql.c:在顶层:
_mysql.c:2288:error:expected'=',',',';','asm'或'__attribute__之前的'*'标记
_mysql.c:2302:错误:expected'=',',',';','asm'或'__attribute__'之前'_mysql_ConnectionObject_methods'
_mysql.c:2517 :错误:数组类型有不完整的元素类型
_mysql.c:2518:错误:'T_INT'未声明在这里(不在一个函数)
_mysql.c:2518:warning:隐式声明函数'offsetof '
_mysql.c:2518:错误:'_mysql_ConnectionObject'之前的预期表达式
_mysql.c:2518:错误:'READONLY'undeclared here(not in a function)
_mysql.c: 2525:error:'T_OBJECT'undeclared here(not in a function)
_mysql.c:2525:error:'_mysql_ConnectionObject'之前的预期表达式
_mysql.c:2532:error:'T_UINT'undeclared here (不在函数中)
_mysql.c:2532:error:'_mysql_ConnectionObject'之前的预期表达式
_mysql.c:2539:错误:'_mysql_ConnectionObject'之前的预期表达式
_mysql.c: 2546:error:expected expression bef $'$ _ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ ','asm'或'__attribute__'在'_mysql_ResultObject_methods'之前
_mysql.c:2608:错误:数组类型有不完整的元素类型
_mysql.c:2609:错误:'_mysql_ResultObject'之前的预期表达式
_mysql.c:2619:'*'标记之前的错误:expected'=',',',';','asm'或'__attribute__'
_mysql.c:2649:error: =',',',';','asm'或'__attribute__'在'*'标记之前
_mysql.c:2681:error:预期的声明说明符或'...'之前的'PyObject'
_mysql.c:在函数'_mysql_ConnectionObject_setattr'中:
_mysql.c:2683:error:'v'undeclared(在此函数中首次使用)
_mysql.c:2684:warning:隐式声明函数'PyErr_SetString'
_mysql.c:2684:error:'PyExc_AttributeError'un声明(在此函数中首次使用)
_mysql.c:2689:warning:隐式声明函数'PyMember_Set'
_mysql.c:在顶层:
_mysql.c:2706:错误:在'PyObject'之前的预期声明说明符或'...'
_mysql.c:在函数'_mysql_ResultObject_setattr'中:
_mysql.c:2708:error:'v'undeclared(在此函数中首次使用)
_mysql.c:2709:error:'PyExc_AttributeError'undeclared(在此函数中首次使用)
_mysql.c:在顶层:
_mysql.c:2727:error:expected' '_mysql_ConnectionObject_Type'
_mysql.c:2815:error:expected'=',',',';','asm'=',',',';','asm'或'__attribute__'或'__attribute__'之前'_mysql_ResultObject_Type'
_mysql.c:2905:错误:expected'=',',',';','asm'或'__attribute__'在'_mysql_methods'之前
_mysql。 c:2977:error:expected'=',',',';','asm'或'__attribute__' '*'token
_mysql.c:3022:warning:返回类型默认为'int'
_mysql.c:在函数'DL_EXPORT'中:
_mysql.c:3022:error:expected 'init_mysql'之前的声明说明符
_mysql.c:3130:错误:预期输入结束时的'{'
错误:安装脚本退出错误:命令'gcc'失败,退出状态1


解决方案

我想你需要先安装python开发库: p>

  yum install python-devel 


I want to run a django project on CentOs. I tried to install mysql-python by easy_install and pip but I got error with both of them. I Googled the problem and found some suggestions, but none of them helped me.

errors are:

_mysql.c:29:20: error: Python.h: No such file or directory
_mysql.c:40:26: error: structmember.h: No such file or directory
_mysql.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:75: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:78: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:80: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:81: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:82: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:83: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:84: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:87: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:100: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:127: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:261: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:361: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:379: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:402: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:403: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_Initialize’:
_mysql.c:405: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:405: error: (Each undeclared identifier is reported only once
_mysql.c:405: error: for each function it appears in.)
_mysql.c:407: warning: initialization from incompatible pointer type
_mysql.c:409: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:409: error: ‘conv’ undeclared (first use in this function)
_mysql.c:409: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:409: warning: statement with no effect
_mysql.c:413: warning: implicit declaration of function ‘PyArg_ParseTupleAndKeywords’
_mysql.c:413: error: ‘args’ undeclared (first use in this function)
_mysql.c:413: error: ‘kwargs’ undeclared (first use in this function)
_mysql.c:417: warning: implicit declaration of function ‘PyDict_New’
_mysql.c:421: warning: implicit declaration of function ‘Py_INCREF’
_mysql.c:423: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:423: error: expected expression before ‘)’ token
_mysql.c:423: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:423: warning: statement with no effect
_mysql.c:425: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:425: warning: statement with no effect
_mysql.c:426: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:426: warning: statement with no effect
_mysql.c:428: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:428: warning: passing argument 1 of ‘mysql_use_result’ from incompatible pointer type
/usr/include/mysql/mysql.h:401: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:430: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:430: warning: passing argument 1 of ‘mysql_store_result’ from incompatible pointer type
/usr/include/mysql/mysql.h:400: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:431: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:431: warning: statement with no effect
_mysql.c:432: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:432: warning: statement with no effect
_mysql.c:434: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:434: warning: passing argument 1 of ‘mysql_field_count’ from incompatible pointer type
/usr/include/mysql/mysql.h:368: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:435: warning: implicit declaration of function ‘_mysql_Exception’
_mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:438: warning: implicit declaration of function ‘PyTuple_New’
_mysql.c:438: warning: statement with no effect
_mysql.c:439: warning: implicit declaration of function ‘Py_DECREF’
_mysql.c:443: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
_mysql.c:443: warning: statement with no effect
_mysql.c:444: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:450: error: ‘tmp’ undeclared (first use in this function)
_mysql.c:450: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:450: error: ‘fun’ undeclared (first use in this function)
_mysql.c:450: warning: left-hand operand of comma expression has no effect
_mysql.c:450: warning: statement with no effect
_mysql.c:451: warning: implicit declaration of function ‘PyInt_FromLong’
_mysql.c:451: warning: statement with no effect
_mysql.c:456: warning: implicit declaration of function ‘PyObject_GetItem’
_mysql.c:456: warning: statement with no effect
_mysql.c:459: warning: implicit declaration of function ‘PyErr_Occurred’
_mysql.c:460: warning: implicit declaration of function ‘PyErr_ExceptionMatches’
_mysql.c:460: error: ‘PyExc_KeyError’ undeclared (first use in this function)
_mysql.c:464: warning: implicit declaration of function ‘PyErr_Clear’
_mysql.c:466: error: ‘Py_None’ undeclared (first use in this function)
_mysql.c:466: warning: statement with no effect
_mysql.c:469: warning: implicit declaration of function ‘PySequence_Check’
_mysql.c:470: warning: implicit declaration of function ‘PySequence_Size’
_mysql.c:471: error: ‘fun2’ undeclared (first use in this function)
_mysql.c:471: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:471: warning: statement with no effect
_mysql.c:473: error: ‘t’ undeclared (first use in this function)
_mysql.c:473: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:473: warning: implicit declaration of function ‘PySequence_GetItem’
_mysql.c:473: warning: statement with no effect
_mysql.c:479: warning: implicit declaration of function ‘PyTuple_Check’
_mysql.c:479: warning: implicit declaration of function ‘PyTuple_GET_SIZE’
_mysql.c:481: error: ‘pmask’ undeclared (first use in this function)
_mysql.c:481: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:481: warning: statement with no effect
_mysql.c:482: warning: implicit declaration of function ‘PyTuple_GET_ITEM’
_mysql.c:482: warning: statement with no effect
_mysql.c:483: warning: statement with no effect
_mysql.c:484: warning: implicit declaration of function ‘PyInt_Check’
_mysql.c:485: warning: implicit declaration of function ‘PyInt_AS_LONG’
_mysql.c:495: warning: statement with no effect
_mysql.c:504: warning: statement with no effect
_mysql.c:507: warning: statement with no effect
_mysql.c:509: warning: implicit declaration of function ‘PyTuple_SET_ITEM’
_mysql.c:509: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_clear’:
_mysql.c:535: warning: implicit declaration of function ‘Py_XDECREF’
_mysql.c:535: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:536: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:536: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:536: warning: statement with no effect
_mysql.c:537: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:538: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:538: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:545: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:546: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
_mysql.c:548: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:548: warning: initialization from incompatible pointer type
_mysql.c:549: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:549: error: ‘conv’ undeclared (first use in this function)
_mysql.c:549: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:549: warning: statement with no effect
_mysql.c:550: error: ‘ssl’ undeclared (first use in this function)
_mysql.c:550: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:550: warning: statement with no effect
_mysql.c:552: warning: initialization from incompatible pointer type
_mysql.c:552: warning: initialization from incompatible pointer type
_mysql.c:552: warning: initialization from incompatible pointer type
_mysql.c:553: warning: initialization from incompatible pointer type
_mysql.c:553: warning: initialization from incompatible pointer type
_mysql.c:555: warning: initialization from incompatible pointer type
_mysql.c:555: warning: initialization from incompatible pointer type
_mysql.c:555: warning: initialization from incompatible pointer type
_mysql.c:556: warning: initialization from incompatible pointer type
_mysql.c:556: warning: initialization from incompatible pointer type
_mysql.c:569: error: initializer element is not constant
_mysql.c:569: error: (near initialization for ‘kwlist[17]’)
_mysql.c:575: warning: initialization from incompatible pointer type
_mysql.c:576: warning: initialization from incompatible pointer type
_mysql.c:577: warning: initialization from incompatible pointer type
_mysql.c:579: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:579: warning: statement with no effect
_mysql.c:580: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:580: warning: statement with no effect
_mysql.c:583: error: ‘args’ undeclared (first use in this function)
_mysql.c:583: error: ‘kwargs’ undeclared (first use in this function)
_mysql.c:616: error: ‘value’ undeclared (first use in this function)
_mysql.c:616: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:616: warning: statement with no effect
_mysql.c:617: warning: implicit declaration of function ‘PyMapping_GetItemString’
_mysql.c:617: warning: statement with no effect
_mysql.c:617: warning: implicit declaration of function ‘PyString_AsString’
_mysql.c:617: warning: assignment makes pointer from integer without a cast
_mysql.c:618: warning: statement with no effect
_mysql.c:618: warning: assignment makes pointer from integer without a cast
_mysql.c:619: warning: statement with no effect
_mysql.c:619: warning: assignment makes pointer from integer without a cast
_mysql.c:620: warning: statement with no effect
_mysql.c:620: warning: assignment makes pointer from integer without a cast
_mysql.c:621: warning: statement with no effect
_mysql.c:621: warning: assignment makes pointer from integer without a cast
_mysql.c:629: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:629: warning: statement with no effect
_mysql.c:630: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:630: warning: passing argument 1 of ‘mysql_init’ from incompatible pointer type
/usr/include/mysql/mysql.h:380: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:633: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:634: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:639: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:640: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:644: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:644: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:648: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:648: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:649: warning: comparison of distinct pointer types lacks a cast
_mysql.c:650: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:650: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:651: warning: comparison of distinct pointer types lacks a cast
_mysql.c:652: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:652: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:653: warning: comparison of distinct pointer types lacks a cast
_mysql.c:654: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:654: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:657: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:657: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
/usr/include/mysql/mysql.h:445: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:661: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:662: warning: passing argument 1 of ‘mysql_ssl_set’ from incompatible pointer type
/usr/include/mysql/mysql.h:381: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:665: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:666: warning: passing argument 1 of ‘mysql_real_connect’ from incompatible pointer type
/usr/include/mysql/mysql.h:387: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:668: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:668: warning: statement with no effect
_mysql.c:677: warning: statement with no effect
_mysql.c:683: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:683: warning: statement with no effect
_mysql.c:691: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:691: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:749: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ConnectionObject_clear’:
_mysql.c:781: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:782: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:782: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:782: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:789: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:817: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:833: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:851: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:870: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:896: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:918: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:950: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:976: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1003: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1022: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1039: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1055: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1077: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1124: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1167: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1169: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1203: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1233: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1267: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1299: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1335: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1359: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1389: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1414: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1453: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1492: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1497: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:1500: error: expected declaration specifiers or ‘...’ before ‘_PYFUNC’
_mysql.c: In function ‘_mysql__fetch_row’:
_mysql.c:1506: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:1506: error: ‘v’ undeclared (first use in this function)
_mysql.c:1506: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:1506: warning: statement with no effect
_mysql.c:1507: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1508: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1508: warning: passing argument 1 of ‘mysql_fetch_row’ from incompatible pointer type
/usr/include/mysql/mysql.h:454: note: expected ‘struct MYSQL_RES *’ but argument is of type ‘char **’
_mysql.c:1510: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:1510: warning: statement with no effect
_mysql.c:1511: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1511: warning: passing argument 1 of ‘mysql_fetch_row’ from incompatible pointer type
/usr/include/mysql/mysql.h:454: note: expected ‘struct MYSQL_RES *’ but argument is of type ‘char **’
_mysql.c:1512: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:1512: warning: statement with no effect
_mysql.c:1514: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:1514: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1514: warning: passing argument 1 of ‘mysql_errno’ from incompatible pointer type
/usr/include/mysql/mysql.h:371: note: expected ‘struct MYSQL *’ but argument is of type ‘char * (*)[1]’
_mysql.c:1515: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:1519: warning: implicit declaration of function ‘_PyTuple_Resize’
_mysql.c:1519: error: ‘r’ undeclared (first use in this function)
_mysql.c:1522: warning: implicit declaration of function ‘convert_row’
_mysql.c:1522: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:1540: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1619: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1647: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1673: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1713: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1755: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1774: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1793: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1808: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1828: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1867: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1885: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1908: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1925: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1941: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1970: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1993: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2023: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2045: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2072: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2098: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2139: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2159: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ConnectionObject_dealloc’:
_mysql.c:2193: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:2193: error: ‘o’ undeclared (first use in this function)
_mysql.c:2193: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
_mysql.c:2193: warning: statement with no effect
_mysql.c:2196: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2197: warning: implicit declaration of function ‘_mysql_ConnectionObject_close’
_mysql.c:2197: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:2197: warning: statement with no effect
_mysql.c:2200: warning: implicit declaration of function ‘PyMem_Free’
_mysql.c: At top level:
_mysql.c:2203: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2224: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2239: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2261: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ResultObject_dealloc’:
_mysql.c:2283: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2283: warning: passing argument 1 of ‘mysql_free_result’ from incompatible pointer type
/usr/include/mysql/mysql.h:447: note: expected ‘struct MYSQL_RES *’ but argument is of type ‘char **’
_mysql.c: At top level:
_mysql.c:2288: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2302: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_methods’
_mysql.c:2517: error: array type has incomplete element type
_mysql.c:2518: error: ‘T_INT’ undeclared here (not in a function)
_mysql.c:2518: warning: implicit declaration of function ‘offsetof’
_mysql.c:2518: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2518: error: ‘READONLY’ undeclared here (not in a function)
_mysql.c:2525: error: ‘T_OBJECT’ undeclared here (not in a function)
_mysql.c:2525: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2532: error: ‘T_UINT’ undeclared here (not in a function)
_mysql.c:2532: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2539: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2546: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2553: error: ‘NULL’ undeclared here (not in a function)
_mysql.c:2556: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_methods’
_mysql.c:2608: error: array type has incomplete element type
_mysql.c:2609: error: expected expression before ‘_mysql_ResultObject’
_mysql.c:2619: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2649: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2681: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ConnectionObject_setattr’:
_mysql.c:2683: error: ‘v’ undeclared (first use in this function)
_mysql.c:2684: warning: implicit declaration of function ‘PyErr_SetString’
_mysql.c:2684: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c:2689: warning: implicit declaration of function ‘PyMember_Set’
_mysql.c: At top level:
_mysql.c:2706: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_setattr’:
_mysql.c:2708: error: ‘v’ undeclared (first use in this function)
_mysql.c:2709: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:2727: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2815: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2905: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:2977: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:3022: warning: return type defaults to ‘int’
_mysql.c: In function ‘DL_EXPORT’:
_mysql.c:3022: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:3130: error: expected ‘{’ at end of input
error: Setup script exited with error: command 'gcc' failed with exit status 1

解决方案

I think you need to install the python development libraries first:

yum install python-devel

这篇关于在CentOs中安装mysql-python返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆