mysqlclient Python Package stop working after Sonoma update

248 views Asked by At

I'm working on a project that uses Django, which connects to a MySQL database, and one of the packages that is used to perform this operation is mysqlclient.

But, early this day my laptop was forced to update his OS to Sonoma (I'm working on a Mac), and after that, when I tried to run the project again, it stopped working, and now it throws this error: enter image description here

I've tried reinstalling my mysql-client with brew and exporting these variables into my .zshrc file without success.

export LDFLAGS="-L/usr/local/opt/mysql-client/lib"
export CPPFLAGS="-I/usr/local/opt/mysql-client/include"
export PKG_CONFIG_PATH="/usr/local/opt/mysql-client/lib/pkgconfig"

Could someone please help me with a solution about this issue?

1

There are 1 answers

0
Jon Latorre On

I find the solution. The problems seems to be that in Sonoma brew install the packages in another path. I've to edit some flags in order to pip can build. With mysql-client 8.1.0 installed the next flags make my pip install work:

export MYSQLCLIENT_CFLAGS="-I/opt/homebrew/Cellar/mysql-client/8.1.0/include/mysql"
export MYSQLCLIENT_LDFLAGS="-L/opt/homebrew/Cellar/mysql-client/8.1.0/lib"