title: Errors installing mysqlclient on Max OSX
body: <p>I am trying to install mysqlclient on Mac OSX, as required by Django to use MySql rather than sqlite DB.</p>
  
  <p>I originally tried <code>pip3 install mysqlclient</code> but I was getting an error like this:</p>
  
  <pre><code>Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3f/1z_bg4h52lz8n0_gc1mp7gwh0000gn/T/pip-install-em4vq6dr/mysqlclient/
  </code></pre>
  
  <p>I have done a lot of Googling and tried so many suggestions (this appears a common issue), and I've ended up with even more of a mess of an error message now:</p>
  
  <pre><code>Collecting mysqlclient==1.3.1
    Downloading https://files.pythonhosted.org/packages/6b/ba/4729d99e85a0a35bb46d55500570de05b4af10431cef174b6da9f58a0e50/mysqlclient-1.3.1.tar.gz (76kB)
      100% |████████████████████████████████| 81kB 2.0MB/s 
  Building wheels for collected packages: mysqlclient
    Building wheel for mysqlclient (setup.py) ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-wheel-41536ku7 --python-tag cp36:
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.6
    copying _mysql_exceptions.py -&gt; build/lib.macosx-10.9-x86_64-3.6
    creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/__init__.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/compat.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/converters.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/connections.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/cursors.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/release.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    copying MySQLdb/times.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
    creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CR.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/ER.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.macosx-10.9-x86_64-3.6
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
    _mysql.c:40:10: fatal error: 'my_config.h' file not found
    #include "my_config.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
  
    ----------------------------------------
    Failed building wheel for mysqlclient
    Running setup.py clean for mysqlclient
  Failed to build mysqlclient
  Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
      Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-3.6
      copying _mysql_exceptions.py -&gt; build/lib.macosx-10.9-x86_64-3.6
      creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/__init__.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/compat.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/converters.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/connections.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/cursors.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/release.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      copying MySQLdb/times.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb
      creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/__init__.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/CR.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/FIELD_TYPE.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/ER.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/FLAG.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/REFRESH.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      copying MySQLdb/constants/CLIENT.py -&gt; build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
      running build_ext
      building '_mysql' extension
      creating build/temp.macosx-10.9-x86_64-3.6
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
      _mysql.c:40:10: fatal error: 'my_config.h' file not found
      #include "my_config.h"
               ^~~~~~~~~~~~~
      1 error generated.
      error: command 'gcc' failed with exit status 1
  
      ----------------------------------------
  Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/
  </code></pre>
  
  <p>Anybody have any suggestions as to where I'm going wrong?</p>
  
  <p>Using Python 3.6</p>
  
  <p>Thanks</p>
  
  <p>Chris</p>