我在centos6.4 64bit中安装了Python2.7,virtualenv和pip2.7,因为python2.6是默认的。
当我尝试使用
安装mysqldb时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,
'打开',打开)(文件)。read()。replace(' \ r \ n',' \ n&# 39;),文件, ' EXEC'))"安装--record /tmp/pip-eNCiSQ-record/install-record.txt --single-version-external-managed --compile失败,错误代码1在/ tmp / pip_build_root / MySQL-python中 在/root/.pip/pip.log中存储失败的调试日志
答案 0 :(得分:3)
看起来您没有安装mysql-devel软件包,这是必需的,以便MySQL-python软件包可以使用未编译的源文件和头文件。
以root身份运行
yum install mysql-devel
再试一次!