MySQLdb安装错误- _mysql。c:44:23:错误:my_config。h:没有这样的文件或目录

时间:2022-10-31 22:53:03

I'm trying to install MySQLdb extension, but I get this error any idea what may be the cause? Could be something with permissions? I'm using Mac OX Lion....

我正在尝试安装MySQLdb扩展,但是我得到了这个错误有什么原因吗?有权限吗?我用Mac牛狮子....

This is a part of the error a got. Django is installed fine, but I need to install this extension. Thanks for any help.

这是错误a的一部分。Django安装得很好,但是我需要安装这个扩展。感谢任何帮助。

ppp-071ca:MySQL-python-1.2.4b4 miguel_e$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-intel/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb
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,4,'beta',4) -
D__version__=1.2.4b4 -I/Applications/MAMP/Library/include -
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 -g
_mysql.c:44:23: error: my_config.h: No such file or directory
_mysql.c:46:19: error: mysql.h: No such file or directory
_mysql.c:47:26: error: mysqld_error.h: No such file or directory
_mysql.c:48:20: error: errmsg.h: No such file or directory
_mysql.c:88: error: expected specifier-qualifier-list before ‘MYSQL’
_mysql.c:102: error: expected specifier-qualifier-list before ‘MYSQL_RES’
_mysql.c: In function ‘_mysql_Exception’:
_mysql.c:146: warning: implicit declaration of function ‘mysql_errno’
_mysql.c:146: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:149: error: ‘CR_MAX_ERROR’ undeclared (first use in this function)
_mysql.c:149: error: (Each undeclared identifier is reported only once
_mysql.c:149: error: for each function it appears in.)
_mysql.c:161: error: ‘CR_COMMANDS_OUT_OF_SYNC’ undeclared (first use in this function)
_mysql.c:162: error: ‘ER_DB_CREATE_EXISTS’ undeclared (first use in this function)
_mysql.c:163: error: ‘ER_SYNTAX_ERROR’ undeclared (first use in this function)
_mysql.c:164: error: ‘ER_PARSE_ERROR’ undeclared (first use in this function)
_mysql.c:165: error: ‘ER_NO_SUCH_TABLE’ undeclared (first use in this function)
_mysql.c:166: error: ‘ER_WRONG_DB_NAME’ undeclared (first use in this function)
_mysql.c:167: error: ‘ER_WRONG_TABLE_NAME’ undeclared (first use in this function)
_mysql.c:168: error: ‘ER_FIELD_SPECIFIED_TWICE’ undeclared (first use in this function)
_mysql.c:169: error: ‘ER_INVALID_GROUP_FUNC_USE’ undeclared (first use in this function)
_mysql.c:170: error: ‘ER_UNSUPPORTED_EXTENSION’ undeclared (first use in this function)
_mysql.c:171: error: ‘ER_TABLE_MUST_HAVE_COLUMNS’ undeclared (first use in this function)
_mysql.c:200: error: ‘ER_DUP_ENTRY’ undeclared (first use in this function)
_mysql.c:246: warning: implicit declaration of function ‘mysql_error’
_mysql.c:246: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:246: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from    
integer without a cast
_mysql.c: In function ‘_mysql_server_init’:
_mysql.c:351: warning: label ‘finish’ defined but not used
_mysql.c:268: warning: unused variable ‘item’
_mysql.c:267: warning: unused variable ‘groupc’
_mysql.c:267: warning: unused variable ‘i’
_mysql.c:267: warning: unused variable ‘cmd_argc’
_mysql.c:266: warning: unused variable ‘s’
_mysql.c: In function ‘_mysql_ResultObject_Initialize’:
_mysql.c:406: error: ‘MYSQL_RES’ undeclared (first use in this function)
_mysql.c:406: error: ‘result’ undeclared (first use in this function)
_mysql.c:411: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:411: error: ‘fields’ undeclared (first use in this function)
_mysql.c:425: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:428: warning: implicit declaration of function ‘mysql_use_result’
_mysql.c:428: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:430: warning: implicit declaration of function ‘mysql_store_result’
_mysql.c:430: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:431: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:434: warning: implicit declaration of function ‘mysql_field_count’
_mysql.c:434: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:442: warning: implicit declaration of function ‘mysql_num_fields’
_mysql.c:443: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
_mysql.c:444: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:448: warning: implicit declaration of function ‘mysql_fetch_fields’
_mysql.c:488: error: ‘BINARY_FLAG’ undeclared (first use in this function)
_mysql.c:509: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_traverse’:
_mysql.c:523: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:524: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_clear’:
_mysql.c:535: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:535: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:535: error: ‘_mysql_ResultObject’ has no member named ‘converger’  
_mysql.c:535: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:536: error: ‘_mysql_ResultObject’ has no member named ‘converger’ 
_mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
_mysql.c:548: error: ‘MYSQL’ undeclared (first use in this function)
_mysql.c:548: error: ‘conn’ undeclared (first use in this function)
_mysql.c:579: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:580: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:602: error: expected expression before ‘)’ token
_mysql.c:631: warning: implicit declaration of function ‘mysql_init’
_mysql.c:631: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:634: warning: implicit declaration of function ‘mysql_options’
_mysql.c:634: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:634: error: ‘MYSQL_OPT_CONNECT_TIMEOUT’ undeclared (first use in this function)
_mysql.c:645: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:645: error: ‘MYSQL_OPT_COMPRESS’ undeclared (first use in this function)
_mysql.c:646: error: ‘CLIENT_COMPRESS’ undeclared (first use in this function)
_mysql.c:649: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:649: error: ‘MYSQL_OPT_NAMED_PIPE’ undeclared (first use in this function)
_mysql.c:651: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:651: error: ‘MYSQL_INIT_COMMAND’ undeclared (first use in this function)
_mysql.c:653: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:653: error: ‘MYSQL_READ_DEFAULT_FILE’ undeclared (first use in this function)
_mysql.c:655: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:655: error: ‘MYSQL_READ_DEFAULT_GROUP’ undeclared (first use in this function)
_mysql.c:658: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’  
_mysql.c:658: error: ‘MYSQL_OPT_LOCAL_INFILE’ undeclared (first use in this function)
_mysql.c:666: warning: implicit declaration of function ‘mysql_real_connect’
_mysql.c:666: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:684: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:692: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_traverse’:
_mysql.c:773: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:774: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_clear’:
_mysql.c:782: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:782: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:782: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:782: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:783: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_close’:
_mysql.c:798: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:800: warning: implicit declaration of function ‘mysql_close’
_mysql.c:800: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:802: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_affected_rows’:
_mysql.c:824: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:825: warning: implicit declaration of function ‘mysql_affected_rows’
_mysql.c:825: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_debug’:
_mysql.c:841: warning: implicit declaration of function ‘mysql_debug’
_mysql.c: In function ‘_mysql_ConnectionObject_dump_debug_info’:
_mysql.c:859: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:861: warning: implicit declaration of function ‘mysql_dump_debug_info’
_mysql.c:861: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_autocommit’:
_mysql.c:885: warning: implicit declaration of function ‘mysql_query’
_mysql.c:885: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_commit’:
_mysql.c:908: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_rollback’:
_mysql.c:930: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_errno’:
_mysql.c:1046: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1047: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_error’:
_mysql.c:1062: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1066: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1066: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from  
integer without a cast
_mysql.c: In function ‘_mysql_escape_string’:
_mysql.c:1099: warning: implicit declaration of function ‘mysql_escape_string’
_mysql.c: In function ‘_mysql_escape’:
_mysql.c:1226: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_describe’:
_mysql.c:1306: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1306: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1309: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1310: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1311: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1322: warning: implicit declaration of function ‘IS_NOT_NULL’
_mysql.c: In function ‘_mysql_ResultObject_field_flags’:
_mysql.c:1342: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1342: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1345: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1346: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1347: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: At top level:
_mysql.c:1393: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_tuple’:
_mysql.c:1399: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1401: warning: implicit declaration of function ‘mysql_fetch_lengths’
_mysql.c:1401: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1401: warning: assignment makes pointer from integer without a cast
_mysql.c:1404: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1405: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1418: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict’:
_mysql.c:1423: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1423: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1425: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1427: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1427: warning: assignment makes pointer from integer without a cast
_mysql.c:1428: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1431: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1432: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1457: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict_old’:
_mysql.c:1462: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1462: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1464: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1466: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1466: warning: assignment makes pointer from integer without a cast
_mysql.c:1467: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1470: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1471: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1493: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql__fetch_row’:
_mysql.c:1504: error: ‘MYSQL_ROW’ undeclared (first use in this function)
_mysql.c:1504: error: expected ‘;’ before ‘row’
_mysql.c:1508: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1509: error: ‘row’ undeclared (first use in this function)
_mysql.c:1509: warning: implicit declaration of function ‘mysql_fetch_row’
_mysql.c:1509: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1512: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1515: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1523: error: too many arguments to function ‘convert_row’
_mysql.c: In function ‘_mysql_ResultObject_fetch_row’:
_mysql.c:1547: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c:1562: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1574: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1588: warning: implicit declaration of function ‘mysql_num_rows’
_mysql.c:1588: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_character_set_name’:
_mysql.c:1655: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_get_client_info’:
_mysql.c:1766: warning: implicit declaration of function ‘mysql_get_client_info’
_mysql.c:1766: 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:1781: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1785: warning: implicit declaration of function ‘mysql_get_host_info’
_mysql.c:1785: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1785: 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:1800: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1801: warning: implicit declaration of function ‘mysql_get_proto_info’
_mysql.c:1801: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_get_server_info’:
_mysql.c:1815: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1819: warning: implicit declaration of function ‘mysql_get_server_info’
_mysql.c:1819: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1819: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from 
integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_info’:
_mysql.c:1836: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1837: warning: implicit declaration of function ‘mysql_info’
_mysql.c:1837: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1837: warning: assignment makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_insert_id’:
_mysql.c:1873: error: ‘my_ulonglong’ undeclared (first use in this function)
_mysql.c:1873: error: expected ‘;’ before ‘r’
_mysql.c:1875: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1877: error: ‘r’ undeclared (first use in this function)
_mysql.c:1877: warning: implicit declaration of function ‘mysql_insert_id’
_mysql.c:1877: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_kill’:
_mysql.c:1894: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1896: warning: implicit declaration of function ‘mysql_kill’
_mysql.c:1896: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_field_count’:
_mysql.c:1915: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1917: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ResultObject_num_fields’:
_mysql.c:1932: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1933: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_num_rows’:
_mysql.c:1948: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1949: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:1978: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1979: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1981: warning: implicit declaration of function ‘mysql_ping’
_mysql.c:1981: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_query’:
_mysql.c:2002: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2004: warning: implicit declaration of function ‘mysql_real_query’
_mysql.c:2004: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_select_db’:
_mysql.c:2032: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2034: warning: implicit declaration of function ‘mysql_select_db’
_mysql.c:2034: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_shutdown’:
_mysql.c:2053: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2055: warning: implicit declaration of function ‘mysql_shutdown’
_mysql.c:2055: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_stat’:
_mysql.c:2080: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2082: warning: implicit declaration of function ‘mysql_stat’
_mysql.c:2082: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’  
...
...  
_mysql.c: At top level:
_mysql.c:2519: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2526: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:2533: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2540: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2547: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2610: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:2610: error: initializer element is not constant
_mysql.c:2610: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)
_mysql.c: In function ‘_mysql_ConnectionObject_getattr’:
_mysql.c:2634: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
lipo: can't open input file: /var/tmp//ccVstRBM.out (No such file or director y)  
error: command 'llvm-gcc-4.2' failed with exit status 1

3 个解决方案

#1


5  

usually when you get these kinds of errors, you are missing development packages - you need to install the header files as they don't come with mysqldb.

通常,当您遇到这些错误时,您会丢失开发包——您需要安装头文件,因为它们不是mysqldb提供的。

i've not done this on apple personally, but here's a link to their article on how to go about such a thing.

我个人还没有在苹果上做过这方面的研究,但是这里有一个链接指向他们关于如何进行这类研究的文章。

http://support.apple.com/kb/ht4006

http://support.apple.com/kb/ht4006

after you've installed the source, mysqldb should be able to compile and install without issues.

在安装了源代码之后,mysqldb应该能够编译和安装,而不会出现任何问题。

#2


28  

If ubuntu : apt-get install mysql-devel If centos/rhel : yum install mysql-devel Then install MySQL-python

如果ubuntu: apt-get安装mysql-devel,如果centos/rhel: yum安装mysql-devel,则安装MySQL-python

#3


1  

i have just get this problem. i tried use the

我刚遇到这个问题。我试着使用

VCForPython27.msi

VCForPython27.msi

to solve it. but it doesn't work..

来解决这个问题。但它不工作。

i find the answer in the Github: PyMySQL/mysqlclient-python,

我在Github上找到了答案:PyMySQL/mysqlclient-python,

NOTE: Wheels for Windows may be not released with source package. You should pin version in your requirements.txt to avoid trying to install newest source package.

注意:Windows的*可能不会随源包释放。您应该将版本固定在您的需求中。避免尝试安装最新的源程序包。

so, the answer is that: assign the version of mysqlclient, use pip install mysqlclient==1.x.x insdead of

因此,答案是:分配mysqlclient的版本,使用pip install mysqlclient==1.x。x insdead

#1


5  

usually when you get these kinds of errors, you are missing development packages - you need to install the header files as they don't come with mysqldb.

通常,当您遇到这些错误时,您会丢失开发包——您需要安装头文件,因为它们不是mysqldb提供的。

i've not done this on apple personally, but here's a link to their article on how to go about such a thing.

我个人还没有在苹果上做过这方面的研究,但是这里有一个链接指向他们关于如何进行这类研究的文章。

http://support.apple.com/kb/ht4006

http://support.apple.com/kb/ht4006

after you've installed the source, mysqldb should be able to compile and install without issues.

在安装了源代码之后,mysqldb应该能够编译和安装,而不会出现任何问题。

#2


28  

If ubuntu : apt-get install mysql-devel If centos/rhel : yum install mysql-devel Then install MySQL-python

如果ubuntu: apt-get安装mysql-devel,如果centos/rhel: yum安装mysql-devel,则安装MySQL-python

#3


1  

i have just get this problem. i tried use the

我刚遇到这个问题。我试着使用

VCForPython27.msi

VCForPython27.msi

to solve it. but it doesn't work..

来解决这个问题。但它不工作。

i find the answer in the Github: PyMySQL/mysqlclient-python,

我在Github上找到了答案:PyMySQL/mysqlclient-python,

NOTE: Wheels for Windows may be not released with source package. You should pin version in your requirements.txt to avoid trying to install newest source package.

注意:Windows的*可能不会随源包释放。您应该将版本固定在您的需求中。避免尝试安装最新的源程序包。

so, the answer is that: assign the version of mysqlclient, use pip install mysqlclient==1.x.x insdead of

因此,答案是:分配mysqlclient的版本,使用pip install mysqlclient==1.x。x insdead