So as a full answer:
If you use the python package mysqlclient you still need to install the mysql client from Oracle/MySQL. This contains the C-library that the python package uses. To make things more confusing: the python package is in fact written in C for speed increases. To install this library on MacOS:
% **brew install mysql-client**
And Second:
add this to PATH:
export DYLD_LIBRARY_PATH=“/usr/local/mysql/lib:$PATH”
After this, I restarted the terminal and ran python manage.py runserver again. No issues.
I have a Mac Studio M1 Max chip, and the following worked for me:
In the env (not in regular terminal): export DYLD_LIBRARY_PATH=/usr/local/mysql/lib pipenv install pymysql
Adding to “settings.py” the following: import pymysql - At the begging of the file OFCOURSE pymysql.install_as_MySQLdb() - right after the DATABASES object