解决:centos安装python-mysql出错
2016-10-27 11:07
417 查看
使用命令pip install mysql-python的时候报错
_mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’
_mysql.c: At top level:
_mysql.c:2739: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_setattr’:
_mysql.c:2741: error: ‘v’ undeclared (first use in this function)
_mysql.c:2742: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:2760: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2848: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2938: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:3010: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:3058: warning: return type defaults to ‘int’
_mysql.c: In function ‘DL_EXPORT’:
_mysql.c:3058: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:3166: error: expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dNMXc/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-YhSNnU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1dNMXc/mysql-python
解决方法:
在安装MySQLdb前安装以下依赖库:
yum install python-devel mysql-devel zlib-devel openssl-devel
依赖库装好之后,执行pip install mysql-python
_mysql.c:2722: warning: implicit declaration of function ‘PyMember_Set’
_mysql.c: At top level:
_mysql.c:2739: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_setattr’:
_mysql.c:2741: error: ‘v’ undeclared (first use in this function)
_mysql.c:2742: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:2760: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2848: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2938: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:3010: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:3058: warning: return type defaults to ‘int’
_mysql.c: In function ‘DL_EXPORT’:
_mysql.c:3058: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:3166: error: expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dNMXc/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-YhSNnU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1dNMXc/mysql-python
解决方法:
在安装MySQLdb前安装以下依赖库:
yum install python-devel mysql-devel zlib-devel openssl-devel
依赖库装好之后,执行pip install mysql-python
相关文章推荐
- Python安装Mysql驱动出错解决(最新出炉)
- Centos7 pip 安装MySQLdb(mysql-python)出错
- CentOS6.5上python-mysql环境的安装问题解决
- centos6.5 python2.7.8 安装scrapy总是出错【解决】
- 【Python】pip安装scrapy、mysqlclient出错的解决方法
- 解决Ubuntu pip 安装 mysql-python包出错的问题
- Centos6.7下安装python连接mysql环境故障解决
- pip安装mysql-python出错的解决方法
- linux下fedora 15 16安装mysql出错以及解决方法
- 安装MySQL时配置到第4步出错的解决办法
- 关于CentOS安装无法安装mysql-python组件问题
- mysql 安装时的第三第四步出错解决方法
- Centos环境下MySQL-python安装过程
- centos 安装mysql遇到configure: error: No curses/termcap library found 解决方法
- 安装python-mysql遇到的问题解决方法
- 安装MySQL时start service出错的解决办法
- CentOS安装python2.6以及MySQL-python
- 64位centos上nginx,php编译安装遇configure: error: Cannot find libmysqlclient under /usr 错误解决
- MySql安装出错解决方法!
- mysql安装配置出错的解决方法