我已在CentOS 6.4 64位系统��安装了Python2.7、virtualenv和pip2.7,因为默认版本是Python2.6。但当我尝试使用"pip install mysqlclient"安装mysqldb时:
错误发生并且已安装Python-devel软件包。
pip2.7 install MySQL-python
错误发生并且已安装Python-devel软件包。
_mysql.c:2551: error: '_mysql_ConnectionObject' has no member named 'open' _mysql.c:2558: error: '_mysql_ConnectionObject' has no member named 'converter' _mysql.c:2565: error: '_mysql_ConnectionObject' has no member named 'connection' _mysql.c:2572: error: '_mysql_ConnectionObject' has no member named 'connection' _mysql.c:2579: error: '_mysql_ConnectionObject' has no member named 'connection' _mysql.c:2642: error: '_mysql_ResultObject' has no member named 'converter' _mysql.c:2642: error: initializer element is not constant _mysql.c:2642: error: (near initialization for '_mysql_ResultObject_memberlist[0].offset') _mysql.c: In function '_mysql_ConnectionObject_getattr': _mysql.c:2666: error: '_mysql_ConnectionObject' has no member named 'open' error: command 'gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/MySQL-python/setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-eNCiSQ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/MySQL-python Storing debug log for failure in /root/.pip/pip.log