Unable to install python mysqlclient - OSError: mysql_config not found I installed mysql through XAMPP.

When I try pip install mysqlclient I get this error

MBP-of-admin:django_project aanto$ pip install mysqlclient
Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
      File "/private/var/folders/jw/4xk541g14mq3ljnws61fbt_m0000gn/T/pip-install-0u41r1pb/mysqlclient/setup.py", line 16, in &lt;module&gt;
        metadata, options = get_config()
      File "/private/var/folders/jw/4xk541g14mq3ljnws61fbt_m0000gn/T/pip-install-0u41r1pb/mysqlclient/setup_posix.py", line 51, in get_config
        libs = mysql_config("libs")
      File "/private/var/folders/jw/4xk541g14mq3ljnws61fbt_m0000gn/T/pip-install-0u41r1pb/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/jw/4xk541g14mq3ljnws61fbt_m0000gn/T/pip-install-0u41r1pb/mysqlclient/


How can I solve?
I found this answer on StackOverflow titled: How to use MYSql from xampp for python 3?.

An answer there shows 3 ways to install the Python drivers/connectors for working with MySQL DBs.

method 1 - MySQL-python

To install the MySQL-python package, type the following command:

 $ pip install MySQL-python


Method 2 - mysql-connector-python

To install the mysql-connector-python package, type the following command:

$ pip install mysql-connector-python


Method 3 - pymysql

To install the pymysql package, type the following command:

$ pip install pymysql


Examples

$ cat mysql_connector_exs.py
hostname = 'localhost'
username = 'USERNAME'
password = 'PASSWORD'
database = 'DBNAME'
def doQuery( conn ) :
cur = conn.cursor()

cur.execute( "SELECT fname, lname FROM employee" )
for firstname, lastname in cur.fetchall() :
    print firstname, lastname
print "Using MySQLdb…"
import MySQLdb
myConnection = MySQLdb.connect( host=hostname, user=username, passwd=password, db=database )
doQuery( myConnection )
myConnection.close()
print "Using pymysql…"
import pymysql
myConnection = pymysql.connect( host=hostname, user=username, passwd=password, db=database )
doQuery( myConnection )
myConnection.close()
print "Using mysql.connector…"
import mysql.connector
myConnection = mysql.connector.connect( host=hostname, user=username, passwd=password, db=database )
doQuery( myConnection )
myConnection.close()