0

I am trying to install Mysql Python in Mac OS X 10.7.2. Got following error:

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

How can I get it right.

I am using: Python 2.7.1 Pro Mysql 5.1.44 (32 bit, bundled with MAMP Pro)

[update: March 18, 2012] After installing xcode and Command Line Tools, while I try to install MySQL Python, got following

_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: can't open input file: /var/tmp//ccYLieFH.out (No such file or directory)

There are lot of such lines

2
  • It seems you don't have the compiler installed, though I'm not sure because I don't have a Mac Commented Mar 15, 2012 at 7:36
  • I have not installed any complier or xcode. Do I need to install them? Commented Mar 15, 2012 at 8:13

1 Answer 1

1

You need to go to the app store. Download Xcode. Once its installed go to Xcode-> preferences ->downloads and install "command line tools". Then run python setup.py build again and it should work

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks bill, I did as you said. but still got error like: _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’

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.