title: Getting Error: did you install mysqlclient? even though mysqlclient is installed on MacOS when trying to access the database in django
body: <p>I am using MacOS 10.13.1 and python version 3.7.2.
  I used <code>pip3 install mysqlclient</code> to install mysqlclient and it was successful:</p>
  
  <pre class="lang-sh prettyprint-override"><code>MacBook-Air:~ user$ pip3 install mysqlclient
  </code></pre>
  
  <pre><code>Collecting mysqlclient
    Using cached https://files.pythonhosted.org/packages/f8/9b/5db9a03e2088a87c26e3e4d4c7f7e8f4c2dbae610f9521cdfac15755a795/mysqlclient-1.4.5.tar.gz
  Building wheels for collected packages: mysqlclient
    Building wheel for mysqlclient (setup.py) ... done
    Created wheel for mysqlclient: filename=mysqlclient-1.4.5-cp37-cp37m-macosx_10_9_x86_64.whl size=56101 sha256=3c1ab2eed45ecf064e60ceda15f2d85f4b01367e7c7e6ed887f483732b9d5e8c
    Stored in directory: /Users/user/Library/Caches/pip/wheels/26/51/0c/3b9ab7013c539c744cddb55989ef494779fa08e8b273ab5ddf
  Successfully built mysqlclient
  Installing collected packages: mysqlclient
  Successfully installed mysqlclient-1.4.5
  </code></pre>
  
  <p>pip3 list confirms that version 1.4.5 of mysqlclient has been installed.</p>
  
  <p>However, when running <code>python3 manage.py makemigrations</code> in the directory containing my project, this error comes up:</p>
  
  <pre class="lang-sh prettyprint-override"><code>MacBook-Air:averages user$ python3 manage.py shell
  </code></pre>
  
  <pre><code>Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 15, in &lt;module&gt;
      import MySQLdb as Database
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in &lt;module&gt;
      from . import _mysql
  ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libmysqlclient.21.dylib
    Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so
    Reason: image not found
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "manage.py", line 21, in &lt;module&gt;
      main()
    File "manage.py", line 17, in main
      execute_from_command_line(sys.argv)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
      utility.execute()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
      django.setup()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
      app_config.import_models()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
      self.models_module = import_module(models_module_name)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/contrib/auth/models.py", line 2, in &lt;module&gt;
      from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 47, in &lt;module&gt;
      class AbstractBaseUser(models.Model):
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/base.py", line 117, in __new__
      new_class.add_to_class('_meta', Options(meta, app_label))
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/base.py", line 321, in add_to_class
      value.contribute_to_class(cls, name)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/options.py", line 204, in contribute_to_class
      self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/__init__.py", line 28, in __getattr__
      return getattr(connections[DEFAULT_DB_ALIAS], item)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/utils.py", line 201, in __getitem__
      backend = load_backend(db['ENGINE'])
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/utils.py", line 110, in load_backend
      return import_module('%s.base' % backend_name)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 20, in &lt;module&gt;
      ) from err
  django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
  Did you install mysqlclient?
  </code></pre>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'averages_db',
          'USER': 'user',
          'PASSWORD': 'password',
      }
  }
  </code></pre>
  
  <p>I have looked at other posts with similar problems but I have found nothing of use. Any help would be appreciated.</p>