我正在尝试在Mac OS X 10.7.2中安装Mysql Python。出现以下错误:
running build_ext
building '_mysql' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -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 i386 -arch x86_64 -pipe -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-intel-2.7/_mysql.o -fno-omit-frame-pointer -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
我怎样才能做对。
我正在使用: Python 2.7.1 Pro Mysql 5.1.44(32位,与MAMP Pro捆绑在一起)
[更新:2012年3月18日] 安装xcode和命令行工具后,当我尝试安装MySQL Python时,得到了以下
_mysql.c: In function ‘_mysql_ConnectionObject_get_host_info’:
_mysql.c:1618: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1619: warning: implicit declaration of function ‘mysql_get_host_info’
_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: warning: implicit declaration of function ‘mysql_get_proto_info’
_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: warning: implicit declaration of function ‘mysql_get_server_info’
_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: warning: implicit declaration of function ‘mysql_info’
_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: warning: implicit declaration of function ‘mysql_insert_id’
_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: warning: implicit declaration of function ‘mysql_kill’
_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: warning: implicit declaration of function ‘mysql_ping’
_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: warning: implicit declaration of function ‘mysql_real_query’
_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: warning: implicit declaration of function ‘mysql_select_db’
_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: warning: implicit declaration of function ‘mysql_shutdown’
_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: warning: implicit declaration of function ‘mysql_stat’
_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: warning: implicit declaration of function ‘mysql_thread_id’
_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:2030: 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: warning: implicit declaration of function ‘mysql_data_seek’
_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: warning: implicit declaration of function ‘mysql_row_tell’
_mysql.c:2070: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2071: warning: implicit declaration of function ‘mysql_row_seek’
_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: 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: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’
lipo:无法打开输入文件:/var/tmp//ccYLieFH.out(没有这样的文件或目录)
有很多这样的行
答案 0 :(得分:1)
您需要前往应用商店。下载Xcode。一旦安装完毕就转到Xcode->首选项 - >下载并安装“命令行工具”。然后再次运行python setup.py build,它应该可以工作