当我在我的虚拟环境中时,我尝试运行:
pip install MySQL-python
这没有奏效,所以我试着下载软件包并运行:
python setup.py install
这将返回以下错误:
%python setup.py install〜VIRTUAL_ENV / build / MySQL-python 运行安装 install_dir /home/damon/Workspace/django-projects/acm-cie/env/lib/python2.6/site-packages/ 运行bdist_egg 运行egg_info 编写MySQL_python.egg-info / PKG-INFO 将顶级名称写入MySQL_python.egg-info / top_level.txt 将dependency_links写入MySQL_python.egg-info / dependency_links.txt 读清单文件“MySQL_python.egg-info / SOURCES.txt” 阅读清单模板'MANIFEST.in' 警告:找不到与“MANIFEST”匹配的文件 警告:找不到与“ChangeLog”匹配的文件 警告:找不到匹配“GPL”的文件 编写清单文件“MySQL_python.egg-info / SOURCES.txt” 安装库代码来构build/ bdist.linux-x86_64 / egg 运行install_lib 运行build_py 复制MySQLdb / release.py - > build / lib.linux-x86_64-2.6 / MySQLdb 运行build_ext build立'_mysql'扩展 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -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-x86_64-2.6 / _mysql.o -DBIG_JOINS = 1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX 在从_mysql.c包含的文件中:29: pymemcompat.h:10:20:错误:Python.h:没有这样的文件或目录 _mysql.c:30:26:错误:structmember.h:没有这样的文件或目录 _mysql.c:62:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:63:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:64:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:65:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:66:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:67:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:68:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:69:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:70:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:71:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:72:error:expected'=',',',';','asm'或'__attribute__'before'*'token _MYSQL.c:75:错误:在'PyObject_HEAD'之前预期的说明符 - 限定符列表 _mysql.c:85:error:expected'=',',';','asm'或'__attribute__'before _mysql_ConnectionObject_Type' _MYSQL.c:88:错误:在'PyObject_HEAD'之前预期的说明符 - 限定符列表 _mysql.c:96:error:expected'=',',';','asm'或'__attribute__''_mysql_ResultObject_Type' _mysql.c:105:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:227:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:318:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:336:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:359:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:360:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:在函数'_mysql_ResultObject_Initialize'中: _mysql.c:362:错误:'NULL'未声明(首次在此函数中使用) _mysql.c:362:错误:(每个未声明的标识符只报告一次 _mysql.c:362:错误:它出现在每个函数中。) _mysql.c:364:警告:从不兼容的指针types进行初始化 _mysql.c:366:错误:'PyObject'未声明(首次在此函数中使用) _mysql.c:366:错误:'conv'未声明(首次在此函数中使用) _mysql.c:366:错误:无效的操作数到二进制*(有'char **'和'char **') _mysql.c:366:warning:语句无效 _mysql.c:370:警告:函数的隐式声明'PyArg_ParseTupleAndKeywords' _mysql.c:370:错误:'args'未声明(首次在此函数中使用) _mysql.c:370:错误:'kwargs'未声明(首次在此函数中使用) _mysql.c:373:警告:函数的隐式声明'PyDict_New' _mysql.c:373:warning:语句无效 _mysql.c:375:错误:'_mysql_ResultObject'没有名为'conn'的成员 _mysql.c:375:错误:''''标记之前的预期expression式 _mysql.c:375:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:375:warning:语句无效 _mysql.c:376:警告:函数'Py_INCREF'的隐式声明 _mysql.c:377:error:'_mysql_ResultObject'没有名为'use'的成员 _mysql.c:377:warning:语句无效 _mysql.c:378:错误:'Py_BEGIN_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:378:warning:语句不起作用 _mysql.c:380:错误:'_mysql_ConnectionObject'没有名为'connection'的成员 _mysql.c:380:警告:从不兼容的指针types传递参数“mysql_use_result” /usr/include/mysql/mysql.h:453:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:382:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:382:警告:从不兼容的指针types传递“mysql_store_result”的参数1 /usr/include/mysql/mysql.h:452:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:383:错误:'_mysql_ResultObject'没有名为'result'的成员 _mysql.c:383:warning:语句无效 _mysql.c:384:错误:'Py_END_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:384:warning:语句无效 _mysql.c:386:错误:'_mysql_ResultObject'没有名为'converter'的成员 _mysql.c:386:警告:函数的隐式声明'PyTuple_New' _mysql.c:386:warning:语句无效 _mysql.c:390:错误:'_mysql_ResultObject'没有名为'nfields'的成员 _mysql.c:390:warning:语句无效 _mysql.c:391:错误:'_mysql_ResultObject'没有名为'converter'的成员 _mysql.c:394:错误:'tmp'未声明(首次在此函数中使用) _mysql.c:394:错误:无效的操作数到二进制*(有'char **'和'char **') _mysql.c:394:error:'fun'未声明(首次在此函数中使用) _mysql.c:394:警告:逗号expression式的左侧操作数不起作用 _mysql.c:394:warning:语句无效 _mysql.c:395:警告:函数的隐式声明'PyInt_FromLong' _mysql.c:395:warning:语句不起作用 _mysql.c:397:警告:函数的隐式声明'PyObject_GetItem' _mysql.c:397:warning:语句不起作用 _mysql.c:398:警告:函数'Py_DECREF'的隐式声明 _mysql.c:400:警告:函数的隐式声明'PyErr_Clear' _mysql.c:401:错误:'Py_None'未声明(首次在此函数中使用) _mysql.c:401:warning:语句无效 _mysql.c:404:警告:函数的隐式声明'PySequence_Check' _mysql.c:405:警告:函数的隐式声明'PySequence_Size' _mysql.c:406:错误:'fun2'未声明(首次在此函数中使用) _mysql.c:406:错误:无效的操作数到二进制*(有'char **'和'char **') _mysql.c:406:warning:语句无效 _mysql.c:408:错误:'t'未声明(首次在此函数中使用) _mysql.c:408:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:408:警告:函数的隐式声明'PySequence_GetItem' _mysql.c:408:warning:语句无效 _mysql.c:410:警告:函数的隐式声明'PyTuple_Check' _mysql.c:411:警告:函数的隐式声明'PyTuple_GET_SIZE' _mysql.c:413:错误:'pmask'未声明(在此函数中首次使用) _mysql.c:413:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:413:warning:语句无效 _mysql.c:414:警告:函数的隐式声明'PyTuple_GET_ITEM' _mysql.c:414:warning:语句无效 _mysql.c:415:warning:语句无效 _mysql.c:416:警告:函数'PyInt_Check'的隐式声明 _mysql.c:417:警告:函数的隐式声明'PyInt_AS_LONG' _mysql.c:433:warning:语句无效 _mysql.c:436:warning:语句不起作用 _mysql.c:438:警告:函数的隐式声明'PyTuple_SET_ITEM' _mysql.c:438:错误:'_mysql_ResultObject'没有名为'converter'的成员 _mysql.c:在函数'_mysql_ResultObject_clear'中: _mysql.c:462:警告:函数'Py_XDECREF'的隐式声明 _mysql.c:462:错误:'_mysql_ResultObject'没有名为'converter'的成员 _mysql.c:463:错误:'_mysql_ResultObject'没有名为'converter'的成员 _mysql.c:463:错误:'NULL'未声明(首次在此函数中使用) _mysql.c:463:warning:语句不起作用 _mysql.c:464:错误:'_mysql_ResultObject'没有名为'conn'的成员 _mysql.c:465:错误:'_mysql_ResultObject'没有名为'conn'的成员 _mysql.c:465:warning:语句无效 _mysql.c:顶层: _mysql.c:472:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:473:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:在函数'_mysql_ConnectionObject_Initialize'中: _mysql.c:475:错误:'NULL'未声明(首次在此函数中使用) _mysql.c:475:警告:从不兼容的指针types初始化 _mysql.c:476:错误:'PyObject'未声明(首次在此函数中使用) _mysql.c:476:错误:'conv'未声明(首次在此函数中使用) _mysql.c:476:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:476:warning:语句不起作用 _mysql.c:477:错误:'ssl'未声明(首次在此函数中使用) _mysql.c:477:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:477:warning:语句无效 _mysql.c:479:警告:从不兼容的指针types进行初始化 _mysql.c:479:警告:从不兼容的指针types进行初始化 _mysql.c:479:警告:从不兼容的指针types进行初始化 _mysql.c:480:警告:从不兼容的指针types初始化 _mysql.c:480:警告:从不兼容的指针types初始化 _mysql.c:482:警告:从不兼容的指针types初始化 _mysql.c:482:警告:从不兼容的指针types初始化 _mysql.c:482:警告:从不兼容的指针types初始化 _mysql.c:483:警告:从不兼容的指针types初始化 _mysql.c:483:警告:从不兼容的指针types初始化 _mysql.c:493:错误:初始化元素不是常量 _mysql.c:493:错误:(靠近'kwlist [16]'的初始化) _mysql.c:496:警告:从不兼容的指针types进行初始化 _mysql.c:497:警告:从不兼容的指针types初始化 _mysql.c:498:警告:从不兼容的指针types进行初始化 _mysql.c:500:错误:'_mysql_ConnectionObject'没有名为'converter'的成员 _mysql.c:500:warning:语句无效 _mysql.c:501:错误:'_mysql_ConnectionObject'没有名为'open'的成员 _mysql.c:501:warning:语句无效 _mysql.c:502:警告:函数的隐式声明'_mysql_Exception' _mysql.c:503:错误:'args'未声明(首次在此函数中使用) _mysql.c:503:错误:'kwargs'未声明(首次在此函数中使用) _mysql.c:523:错误:'值'未声明(首次在此函数中使用) _mysql.c:523:错误:无效的操作数为二进制*(有'char **'和'char **') _mysql.c:523:warning:语句无效 _mysql.c:524:警告:函数的隐式声明'PyMapping_GetItemString' _mysql.c:524:warning:语句不起作用 _mysql.c:524:警告:函数的隐式声明'PyString_AsString' _mysql.c:524:警告:赋值使得整型指针没有强制转换 _mysql.c:525:warning:语句无效 _mysql.c:525:警告:赋值使得整型指针没有强制转换 _mysql.c:526:warning:语句无效 _mysql.c:526:警告:赋值使得整型指针没有强制转换 _mysql.c:527:warning:语句不起作用 _mysql.c:527:警告:赋值使得整型指针没有强制转换 _mysql.c:528:warning:语句无效 _mysql.c:528:警告:赋值使得整型指针没有强制转换 _mysql.c:536:错误:'Py_BEGIN_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:536:warning:语句无效 _mysql.c:537:错误:'_mysql_ConnectionObject'没有名为'connection'的成员 _mysql.c:537:警告:从不兼容的指针types中传递“mysql_init”的参数1 /usr/include/mysql/mysql.h:432:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:540:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:541:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:544:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:544:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:548:error:'_mysql_ConnectionObject'没有名为'connection'的成员 _mysql.c:548:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:549:警告:不同指针types的比较缺less强制转换 _mysql.c:550:错误:'_mysql_ConnectionObject'没有名为'connection'的成员 _mysql.c:550:警告:从不兼容的指针types传递参数1的'mysql_options' /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:551:警告:不同指针types的比较缺less强制转换 _mysql.c:552:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:552:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:553:警告:不同指针types的比较缺less强制转换 _mysql.c:554:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:554:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:557:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:557:警告:从不兼容的指针types中传递“mysql_options”的参数1 /usr/include/mysql/mysql.h:538:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:561:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:562:警告:从不兼容的指针types中传递“mysql_ssl_set”的参数1 /usr/include/mysql/mysql.h:433:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:565:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:566:警告:从不兼容的指针types中传递“mysql_real_connect”的参数1 /usr/include/mysql/mysql.h:439:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:568:错误:'Py_END_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:568:warning:语句没有效果 _mysql.c:577:warning:语句不起作用 _mysql.c:583:错误:'_mysql_ConnectionObject'没有名为'converter'的成员 _mysql.c:583:warning:语句无效 _mysql.c:591:错误:'_mysql_ConnectionObject'没有名为'open'的成员 _mysql.c:591:warning:语句无效 _mysql.c:顶层: _mysql.c:649:error'expected'=',',';','asm'或'__attribute__'在'*'之前 _mysql.c:在函数'_mysql_ConnectionObject_clear'中: _mysql.c:681:错误:'_mysql_ConnectionObject'没有名为'converter'的成员 _mysql.c:682:错误:'_mysql_ConnectionObject'没有名为'converter'的成员 _mysql.c:682:错误:'NULL'未声明(首次在此函数中使用) _mysql.c:682:warning:语句无效 _mysql.c:顶层: _mysql.c:689:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:717:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:733:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:751:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:770:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:796:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:818:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:850:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:876:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:903:error'expected'=',',';','asm'或'__attribute__'在'*'之前 _mysql.c:918:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:935:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:951:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:969:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:1004:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1035:error'expected'=',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1037:error:expected'=',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1067:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:1097:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:1131:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1163:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1199:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1223:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1248:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1273:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1312:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1351:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1356:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:1359:错误:期望的声明说明符或'...'在'_PYFUNC' _mysql.c:在函数'_mysql__fetch_row'中: _mysql.c:1365:错误:'PyObject'未声明(首次在此函数中使用) _mysql.c:1365:错误:'v'未声明(在此函数中首次使用) _mysql.c:1365:错误:无效的操作数到二进制*(有'char **'和'char **') _mysql.c:1365:warning:语句不起作用 _mysql.c:1366:错误:'_mysql_ResultObject'没有名为'use'的成员 _mysql.c:1367:错误:'_mysql_ResultObject'没有名为'result'的成员 _mysql.c:1367:警告:从不兼容的指针types传递参数1的'mysql_fetch_row' /usr/include/mysql/mysql.h:547:note:expected'struct MYSQL_RES *'but argument is of type'char **' _mysql.c:1369:错误:'Py_BEGIN_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:1369:警告:语句没有效果 _mysql.c:1370:错误:'_mysql_ResultObject'没有名为'result'的成员 _mysql.c:1370:警告:从不兼容的指针types传递参数1的'mysql_fetch_row' /usr/include/mysql/mysql.h:547:note:expected'struct MYSQL_RES *'but argument is of type'char **' _mysql.c:1371:错误:'Py_END_ALLOW_THREADS'未声明(首次在此函数中使用) _mysql.c:1371:warning:语句无效 _mysql.c:1373:错误:'_mysql_ResultObject'没有名为'conn'的成员 _mysql.c:1373:错误:'_mysql_ConnectionObject'没有名为'连接'的成员 _mysql.c:1373:警告:从不兼容的指针types传递“mysql_errno”的参数1 /usr/include/mysql/mysql.h:423:note:expected'struct MYSQL *'but argument is of type'char *(*)[1]' _mysql.c:1374:错误:'_mysql_ResultObject'没有名为'conn'的成员 _mysql.c:1378:警告:函数的隐式声明'_PyTuple_Resize' _mysql.c:1378:错误:'r'未声明(首次在此函数中使用) _mysql.c:1381:警告:函数的隐式声明'convert_row' _mysql.c:1381:warning:语句无效 _mysql.c:顶层: _mysql.c:1399:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:1478:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1506:error'expected'=',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1528:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1568:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:1597:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1612:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1627:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1642:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1658:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1693:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1711:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1734:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1751:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1767:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1796:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1819:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1849:error:expected'=',',',';','asm'或'__attribute__''*'token _mysql.c:1871:error:expected'=',',',';','asm'或'__attribute__''*'token _mysql.c:1898:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1919:error:expected'=',',',';','asm'或'__attribute__'在'*'之前 _mysql.c:1960:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:1980:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:在函数'_mysql_ConnectionObject_dealloc'中: _mysql.c:2014:error:'PyObject'未声明(首次在此函数中使用) _mysql.c:2014:错误:'o'未声明(首次在此函数中使用) _mysql.c:2014:错误:无效的操作数到二进制*(有'char **'和'char **') _mysql.c:2014:warning:语句无效 _mysql.c:2017:错误:'_mysql_ConnectionObject'没有名为'open'的成员 _mysql.c:2018:警告:函数的隐式声明'_mysql_ConnectionObject_close' _mysql.c:2018:错误:'NULL'未声明(首次在此函数中使用) _mysql.c:2018:warning:语句无效 _mysql.c:2021:警告:函数的隐式声明'PyMem_Free' _mysql.c:顶层: _mysql.c:2024:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2041:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2056:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2078:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:在函数'_mysql_ResultObject_dealloc'中: _mysql.c:2100:错误:'_mysql_ResultObject'没有名为'result'的成员 _mysql.c:2100:警告:从不兼容的指针types中传递“mysql_free_result”的参数1 /usr/include/mysql/mysql.h:540:note:expected'struct MYSQL_RES *'but argument is of type'char **' _mysql.c:顶层: _mysql.c:2105:error'expected'=',',';','asm'或'__attribute__'before'*'token _mysql.c:2115:error:expected'=',',';','asm'或'__attribute__'before _mysql_ConnectionObject_methods' _mysql.c:2330:错误:数组types具有不完整的元素types _mysql.c:2331:错误:'T_INT'这里未声明(不在函数中) _mysql.c:2331:警告:函数的隐式声明'offsetof' _mysql.c:2331:错误:预期的expression式'_mysql_ConnectionObject' _mysql.c:2331:错误:'RO'在这里未声明(不在函数中) _mysql.c:2338:错误:'T_OBJECT'未声明在这里(不在函数中) _mysql.c:2338:错误:预期expression式'_mysql_ConnectionObject' _mysql.c:2345:错误:'T_UINT'这里未声明(不在函数中) _mysql.c:2345:错误:_mysql_ConnectionObject之前的预期expression式 _mysql.c:2352:错误:预期expression式'_mysql_ConnectionObject' _mysql.c:2359:错误:预期的expression式'_mysql_ConnectionObject' _mysql.c:2366:错误:'NULL'在此处未声明(不在函数中) _mysql.c:2369:error'expected'=',',';','asm'或'__attribute__''_mysql_ResultObject_methods' _mysql.c:2421:错误:数组types具有不完整的元素types _mysql.c:2422:错误:预期expression式'_mysql_ResultObject' _mysql.c:2432:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2460:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2490:错误:期望的声明说明符或“...”在“PyObject” _mysql.c:在函数'_mysql_ConnectionObject_setattr'中: _mysql.c:2492:错误:'v'未声明(首次在此函数中使用) _mysql.c:2493:警告:函数的隐式声明'PyErr_SetString' _mysql.c:2493:错误:'PyExc_AttributeError'未声明(首次在此函数中使用) _mysql.c:2498:警告:函数的隐式声明'PyMember_Set' _mysql.c:顶层: _mysql.c:2515:错误:期望的声明说明符或'...'在'PyObject' _mysql.c:在函数'_mysql_ResultObject_setattr'中: _mysql.c:2517:错误:'v'未声明(首次在此函数中使用) _mysql.c:2518:错误:'PyExc_AttributeError'未声明(首次在此函数中使用) _mysql.c:顶层: _mysql.c:2536:error:expected'=',',',';','asm'或'__attribute__''_mysql_ConnectionObject_Type' _mysql.c:2620:error:expected'=',',',';','asm'或'__attribute__'before _mysql_ResultObject_Type' _mysql.c:2706:error:expected'=',',';','asm'或'__attribute__'before _mysql_methods' _mysql.c:2778:error:expected'=',',',';','asm'或'__attribute__'before'*'token _mysql.c:2810:警告:返回types默认为'int' _mysql.c:在函数'DL_EXPORT'中: _mysql.c:2810:错误:“init_mysql”之前的预期声明说明符 _mysql.c:2888:错误:预期'{'在input结束 错误:命令'gcc'失败,退出状态为1
如何在启用了“no-site-packages”的虚拟环境中在Ubuntu上安装MySQL-python?
这是发生的原因是因为我需要安装python-dev包(我愚蠢地假设已经安装)。
% sudo apt-get install python-dev
其次是
% pip install MySQL-python
您可能还需要在某些Ubuntu安装中安装libmysqlclient-dev
sudo apt-get install python-dev libmysqlclient-dev
这就是阻止我(在python的开发顶部)。