安装MySQL-python报错 error: command 'gcc' failed with exit status 1解决方法
錯誤如:
_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’
error: command 'gcc' failed with exit status 1
要安裝的庫與系統庫沖突了;
解決方法:
1、找出已安裝的MySQL:
rpm -qa | grep -i mysql
2、執行如下刪除命令:
rpm -ev mysql-5.1.73-3.el6_5.x86_64
rpm -ev mysql-libs-5.1.73-3.el6_5.x86_64
rpm -ev MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
3、重新安裝:
yum -y install mysql-devel
4、執行安裝命令:
python setup.py build
python setup.py install
5、運行python:
python
搞定!
完美!
總結
以上是生活随笔為你收集整理的安装MySQL-python报错 error: command 'gcc' failed with exit status 1解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Golang 垃圾回收剖析
- 下一篇: 【转载】MySQL索引背后的数据结构及算