Install mysqlclient for mariadb on mac os for python3

I have a processing problem for pip install mysqlclient for Python3 on MAC OS Sierra.

 running build_ext building '_mysql' extension creating build/temp.macosx-10.12-x86_64-3.6 clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/openssl/1.0.2k/include -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 -I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/.. -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.12-x86_64-3.6/_mysql.o _mysql.c:1911:42: error: no member named 'reconnect' in 'struct st_mysql' if ( reconnect != -1 ) self->connection.reconnect = reconnect; ~~~~~~~~~~~~~~~~ ^ 1 error generated. error: command 'clang' failed with exit status 1 

I installed MariaDB and xcode-select --install , and also processed it.

+6
source share
2 answers

The problem is here, since mariadb 10.2.x, with mariadb 10.1.23 I have no problem installing mysqlclient .

So, with mariadb 10.2.x we need to install mariadb-connector-c :

 brew unlink mariadb brew install mariadb-connector-c ln -s /usr/local/opt/mariadb-connector-c/bin/mariadb_config /usr/local/bin/mysql_config pip install mysqlclient rm /usr/local/bin/mysql_config brew unlink mariadb-connector-c brew link mariadb 

UPDATE: bug fixed in mysqlclient (see https://github.com/PyMySQL/mysqlclient-python/pull/177 ) but not yet released

+17
source

SOLVE:

 pip uninstall mysqlclient pip install -U git+git://github.com/PyMySQL/mysqlclient-python 
+5
source

Source: https://habr.com/ru/post/1268318/


All Articles