Я не могу установить библиотеку Python mysqlclient через pip3 из-за следующей ошибки
$ 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
ОС — CentOS Linux версии 7.7.1908 (Core), версия gcc показана ниже.
$ 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.
Пришлось установить новую версию gcc, к сожалению пакета нет в стандартных репозиториях, и пришлось добавить в систему репозиторий Software Collections, подробный пост как это сделать можно найти здесь.
yum install centos-release-scl -y
yum install devtoolset-7-gcc* -y
scl enable devtoolset-7 bash
pip3 install mysqlclient