- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在运行 Mac Lion。我已经安装了 python 2.7.2 和 django 1.3.1。他们两个都工作正常。为了使 python 与 mysql 一起工作,我必须安装 MySQL-python-1.2.3——但我无法使构建工作。对于 MySQL,我有 XAMPP,我已将 XAMPP 的 bin 设置为构建所需的 mysql_config 的系统环境路径。
SOFXGF-AIR:MySQL-python-1.2.3 Sofia$ python setup.py buildrunning build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/XAMPP/xamppfiles/include/mysql -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -mmacosx-version-min=10.4 -arch i386 -arch ppc -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
from pymemcompat.h:10,
from _mysql.c:29:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.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:76: error: expected specifier-qualifier-list before ‘MYSQL’
_mysql.c:90: error: expected specifier-qualifier-list before ‘MYSQL_RES’
_mysql.c: In function ‘_mysql_Exception’:
_mysql.c:120: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:123: error: ‘CR_MAX_ERROR’ undeclared (first use in this function)
_mysql.c:123: error: (Each undeclared identifier is reported only once
_mysql.c:123: error: for each function it appears in.)
_mysql.c:131: error: ‘CR_COMMANDS_OUT_OF_SYNC’ undeclared (first use in this function)
_mysql.c:132: error: ‘ER_DB_CREATE_EXISTS’ undeclared (first use in this function)
_mysql.c:133: error: ‘ER_SYNTAX_ERROR’ undeclared (first use in this function)
_mysql.c:134: error: ‘ER_PARSE_ERROR’ undeclared (first use in this function)
_mysql.c:135: error: ‘ER_NO_SUCH_TABLE’ undeclared (first use in this function)
_mysql.c:136: error: ‘ER_WRONG_DB_NAME’ undeclared (first use in this function)
_mysql.c:137: error: ‘ER_WRONG_TABLE_NAME’ undeclared (first use in this function)
_mysql.c:138: error: ‘ER_FIELD_SPECIFIED_TWICE’ undeclared (first use in this function)
_mysql.c:139: error: ‘ER_INVALID_GROUP_FUNC_USE’ undeclared (first use in this function)
_mysql.c:140: error: ‘ER_UNSUPPORTED_EXTENSION’ undeclared (first use in this function)
_mysql.c:141: error: ‘ER_TABLE_MUST_HAVE_COLUMNS’ undeclared (first use in this function)
_mysql.c:170: error: ‘ER_DUP_ENTRY’ undeclared (first use in this function)
_mysql.c:213: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:213: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ResultObject_Initialize’:
_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:368: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:368: error: ‘fields’ undeclared (first use in this function)
_mysql.c:377: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:380: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:382: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:383: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:386: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:390: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
_mysql.c:391: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_traverse’:
_mysql.c:450: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:451: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_clear’:
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:463: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_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:500: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:501: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:537: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_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: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:550: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:550: error: ‘MYSQL_INIT_COMMAND’ undeclared (first use in this function)
_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: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: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:583: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:591: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_traverse’:
_mysql.c:672: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:673: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_clear’:
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:682: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_close’:
_mysql.c:697: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:699: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:701: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_affected_rows’:
_mysql.c:723: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:724: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_dump_debug_info’:
_mysql.c:758: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:760: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_autocommit’:
_mysql.c:784: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_commit’:
_mysql.c:807: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_rollback’:
_mysql.c:829: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_errno’:
_mysql.c:941: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:942: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_error’:
_mysql.c:957: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:958: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:958: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_escape’:
_mysql.c:1089: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_describe’:
_mysql.c:1169: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1169: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1172: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1173: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1174: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_field_flags’:
_mysql.c:1205: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1205: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1208: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1209: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1210: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: At top level:
_mysql.c:1251: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_tuple’:
_mysql.c:1257: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1259: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1259: warning: assignment makes pointer from integer without a cast
_mysql.c:1262: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1263: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1276: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict’:
_mysql.c:1281: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1281: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1283: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1285: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1285: warning: assignment makes pointer from integer without a cast
_mysql.c:1286: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1289: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1290: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1315: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict_old’:
_mysql.c:1320: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1320: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1322: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1324: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1324: warning: assignment makes pointer from integer without a cast
_mysql.c:1325: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1328: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1329: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1351: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql__fetch_row’:
_mysql.c:1362: error: ‘MYSQL_ROW’ undeclared (first use in this function)
_mysql.c:1362: error: expected ‘;’ before ‘row’
_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: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1370: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1373: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1381: error: too many arguments to function ‘convert_row’
_mysql.c: In function ‘_mysql_ResultObject_fetch_row’:
_mysql.c:1405: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c:1420: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1432: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1446: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_character_set_name’:
_mysql.c:1513: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_get_client_info’:
_mysql.c:1604: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_get_host_info’:
_mysql.c:1618: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1619: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1619: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_get_proto_info’:
_mysql.c:1633: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1634: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_get_server_info’:
_mysql.c:1648: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1649: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1649: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_info’:
_mysql.c:1665: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1666: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1666: warning: assignment makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_insert_id’:
_mysql.c:1698: error: ‘my_ulonglong’ undeclared (first use in this function)
_mysql.c:1698: error: expected ‘;’ before ‘r’
_mysql.c:1700: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1702: error: ‘r’ undeclared (first use in this function)
_mysql.c:1702: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_kill’:
_mysql.c:1719: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1721: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_field_count’:
_mysql.c:1740: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1742: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ResultObject_num_fields’:
_mysql.c:1757: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1758: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_num_rows’:
_mysql.c:1773: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1774: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:1803: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1804: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1806: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_query’:
_mysql.c:1827: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1829: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_select_db’:
_mysql.c:1857: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1859: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_shutdown’:
_mysql.c:1878: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1880: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_stat’:
_mysql.c:1905: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1907: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1907: warning: assignment makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_store_result’:
_mysql.c:1928: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1929: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:1938: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_thread_id’:
_mysql.c:1967: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1969: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_use_result’:
_mysql.c:1989: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1990: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:1999: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_dealloc’:
_mysql.c:2017: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_repr’:
_mysql.c:2029: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2031: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ResultObject_data_seek’:
_mysql.c:2048: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2049: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_row_seek’:
_mysql.c:2062: error: ‘MYSQL_ROW_OFFSET’ undeclared (first use in this function)
_mysql.c:2062: error: expected ‘;’ before ‘r’
_mysql.c:2064: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2065: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:2070: error: ‘r’ undeclared (first use in this function)
_mysql.c:2070: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2071: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_row_tell’:
_mysql.c:2083: error: ‘MYSQL_ROW_OFFSET’ undeclared (first use in this function)
_mysql.c:2083: error: expected ‘;’ before ‘r’
_mysql.c:2085: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2086: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:2091: error: ‘r’ undeclared (first use in this function)
_mysql.c:2091: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2092: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_dealloc’:
_mysql.c:2100: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: At top level:
_mysql.c:2331: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2338: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:2345: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2352: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2359: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2422: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:2422: error: initializer element is not constant
_mysql.c:2422: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)
_mysql.c: In function ‘_mysql_ConnectionObject_getattr’:
_mysql.c:2444: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
gcc-4.2: error trying to exec '/usr/bin/powerpc-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/jr/zhr6zd952zv84lqwbhm05k4m0000gn/T//ccthbt7t.out
error: command 'gcc-4.2' failed with exit status 255
我不确定这是否正确,但我也尝试了 sudo env ARCHFLAGS='-arch x86_64' python setup.py build
因为我注意到 -arch ppc
错误消息中提到了。但是,我仍然遇到同样的错误。也可能有一些关于 No such file or directory
的错误?我安装了 XCode 4。
最佳答案
您还需要安装 mysql-devel 软件包。始终注意 .h 扩展文件。如果您因为它们而看到错误,则表示未安装开发包,而您编译的软件需要它。
由于您使用的是 Mac,因此您需要 MySQL 的未编译源文件,以便它可以访问这些头文件。您可以在这里获取:http://dev.mysql.com/downloads/mirror.php?id=405008
您可能必须告诉构建命令这些文件所在的位置。试试 python ./setup.py --help
关于python - MySQLdb Python 连接器构建和安装命令 'gcc-4.2' 失败,退出状态为 255,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8623212/
我正在处理一组标记为 160 个组的 173k 点。我想通过合并最接近的(到 9 或 10 个组)来减少组/集群的数量。我搜索过 sklearn 或类似的库,但没有成功。 我猜它只是通过 knn 聚类
我有一个扁平数字列表,这些数字逻辑上以 3 为一组,其中每个三元组是 (number, __ignored, flag[0 or 1]),例如: [7,56,1, 8,0,0, 2,0,0, 6,1,
我正在使用 pipenv 来管理我的包。我想编写一个 python 脚本来调用另一个使用不同虚拟环境(VE)的 python 脚本。 如何运行使用 VE1 的 python 脚本 1 并调用另一个 p
假设我有一个文件 script.py 位于 path = "foo/bar/script.py"。我正在寻找一种在 Python 中通过函数 execute_script() 从我的主要 Python
这听起来像是谜语或笑话,但实际上我还没有找到这个问题的答案。 问题到底是什么? 我想运行 2 个脚本。在第一个脚本中,我调用另一个脚本,但我希望它们继续并行,而不是在两个单独的线程中。主要是我不希望第
我有一个带有 python 2.5.5 的软件。我想发送一个命令,该命令将在 python 2.7.5 中启动一个脚本,然后继续执行该脚本。 我试过用 #!python2.7.5 和http://re
我在 python 命令行(使用 python 2.7)中,并尝试运行 Python 脚本。我的操作系统是 Windows 7。我已将我的目录设置为包含我所有脚本的文件夹,使用: os.chdir("
剧透:部分解决(见最后)。 以下是使用 Python 嵌入的代码示例: #include int main(int argc, char** argv) { Py_SetPythonHome
假设我有以下列表,对应于及时的股票价格: prices = [1, 3, 7, 10, 9, 8, 5, 3, 6, 8, 12, 9, 6, 10, 13, 8, 4, 11] 我想确定以下总体上最
所以我试图在选择某个单选按钮时更改此框架的背景。 我的框架位于一个类中,并且单选按钮的功能位于该类之外。 (这样我就可以在所有其他框架上调用它们。) 问题是每当我选择单选按钮时都会出现以下错误: co
我正在尝试将字符串与 python 中的正则表达式进行比较,如下所示, #!/usr/bin/env python3 import re str1 = "Expecting property name
考虑以下原型(prototype) Boost.Python 模块,该模块从单独的 C++ 头文件中引入类“D”。 /* file: a/b.cpp */ BOOST_PYTHON_MODULE(c)
如何编写一个程序来“识别函数调用的行号?” python 检查模块提供了定位行号的选项,但是, def di(): return inspect.currentframe().f_back.f_l
我已经使用 macports 安装了 Python 2.7,并且由于我的 $PATH 变量,这就是我输入 $ python 时得到的变量。然而,virtualenv 默认使用 Python 2.6,除
我只想问如何加快 python 上的 re.search 速度。 我有一个很长的字符串行,长度为 176861(即带有一些符号的字母数字字符),我使用此函数测试了该行以进行研究: def getExe
list1= [u'%app%%General%%Council%', u'%people%', u'%people%%Regional%%Council%%Mandate%', u'%ppp%%Ge
这个问题在这里已经有了答案: Is it Pythonic to use list comprehensions for just side effects? (7 个答案) 关闭 4 个月前。 告
我想用 Python 将两个列表组合成一个列表,方法如下: a = [1,1,1,2,2,2,3,3,3,3] b= ["Sun", "is", "bright", "June","and" ,"Ju
我正在运行带有最新 Boost 发行版 (1.55.0) 的 Mac OS X 10.8.4 (Darwin 12.4.0)。我正在按照说明 here构建包含在我的发行版中的教程 Boost-Pyth
学习 Python,我正在尝试制作一个没有任何第 3 方库的网络抓取工具,这样过程对我来说并没有简化,而且我知道我在做什么。我浏览了一些在线资源,但所有这些都让我对某些事情感到困惑。 html 看起来
我是一名优秀的程序员,十分优秀!