首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我尝试通过pip安装mysqlclient时,遇到‘for’循环的初始声明仅在C99模式错误中被允许

问当我尝试通过pip安装mysqlclient时,遇到‘for’循环的初始声明仅在C99模式错误中被允许
EN

Stack Overflow用户
提问于 2020-12-19 02:22:59
回答 1查看 639关注 0票数 0

由于以下错误,我无法通过pip3安装Python mysqlclient库

代码语言:javascript
复制
$ pip3.6 install mysqlclient
...
MySQLdb/_mysql.c: In function ‘_mysql_row_to_dict_cached’:
MySQLdb/_mysql.c:1340:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (unsigned int i=0; i

The OS is CentOS Linux release 7.7.1908 (Core), the gcc version is shown below

代码语言:javascript
复制
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-19 06:15:29

我不得不安装一个新的gcc版本,不幸的是这个包没有出现在标准的库中,我不得不将软件集合库添加到系统中,详细的操作方法可以在here上找到。

代码语言:javascript
复制
    yum install centos-release-scl -y
    yum install devtoolset-7-gcc* -y
    scl enable devtoolset-7 bash
    pip3 install mysqlclient
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65362111

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档