python mysql gcc_MySQL-python “error: command 'gcc' failed with exit status 1”错误
安裝MySQL-python-1.2.3c1出現(xiàn)“error: command 'gcc' failed with exit status 1”錯(cuò)誤
具體報(bào)錯(cuò)信息如下:
_mysql.c: 在文件層:
_mysql.c:2330: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘open’的成員
_mysql.c:2337: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘converter’的成員
_mysql.c:2344: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘connection’的成員
_mysql.c:2351: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘connection’的成員
_mysql.c:2358: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘connection’的成員
_mysql.c:2421: 錯(cuò)誤:‘_mysql_ResultObject’沒有名為‘converter’的成員
_mysql.c:2421: 錯(cuò)誤:初始值設(shè)定元素不是常量
_mysql.c:2421: 錯(cuò)誤:(在‘_mysql_ResultObject_memberlist[0].offset’的初始化附近)
_mysql.c: 在函數(shù)‘_mysql_ConnectionObject_getattr’中:
_mysql.c:2443: 錯(cuò)誤:‘_mysql_ConnectionObject’沒有名為‘open’的成員
error: command 'gcc' failed with exit status 1
環(huán)境為:
系統(tǒng)版本:ORALCE_RHEL6
Python版本:2.7.8
Mysql-python的site.cfg文件內(nèi)容如下:
[root@oracle MySQL-python-1.2.3c1]# cat site.cfg
[options]
# embedded: link against the embedded server library
# threadsafe: use the threadsafe client
# static: link against a static library (probably required for embedded)
embedded = False
threadsafe = False
static = False
# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.
mysql_config =/usr/bin/mysql_config
# The Windows registry key for MySQL.
# This has to be set for Windows builds to work.
# Only change this if you have a different version.
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
已經(jīng)安裝:
[root@oracle Packages]# rpm -ivh python-devel-2.6.6-51.el6.i686.rpm
Preparing... ########################################### [100%]
1:python-devel ########################################### [100%]
[root@oracle Packages]# rpm -ivh MySQL-python-1.2.3-0.3.c1.1.el6.i686.rpm
Preparing... ########################################### [100%]
1:MySQL-python ########################################### [100%]
還是存在error: command 'gcc' failed with exit status 1
現(xiàn)在應(yīng)該如何解決呢?
——————
最后還是被我自己解決了,在windows下已經(jīng)安裝過MySQLdb了,但是在linux下安裝不成功,很懊惱。
現(xiàn)在寫下解決方法(還是走了很多彎路,好年輕啊!!!):
安裝所有的依賴:
yum install python-devel mysql-devel zlib-devel openssl-devel
總結(jié)
以上是生活随笔為你收集整理的python mysql gcc_MySQL-python “error: command 'gcc' failed with exit status 1”错误的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql数据类型分析_MYSQL数据类
- 下一篇: log4j 压缩日志_Spring Bo