title: ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
body: <p>I'm working on a Google App Engine project and have been running into issues trying to set up the basic Django Admin Site with MySQL. I have searched around about this question, but all I see people posting about deals with running apps locally. In my situation, I'm getting an error when running the app in Google App Engine.</p>
  
  <p>To be more specific about the issue, I get the following error in the logs for my application:</p>
  
  <pre><code>ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
  </code></pre>
  
  <p>This makes it seem like MySQL isn't even installed, which doesn't really make sense. It should be accessible by default in GAE. Is there another issue that I'm not seeing? This is confusing for me because it doesn't even give me a specific line to look at, or any kind of lead.</p>
  
  <p>I've looked through the GAE documentation for Django and CloudSQL but nothing I had seemed out of place. I also took a look at the example Django app and all of my content didn't seem to conflict with what they had there.</p>
  
  <p>The full log is here:</p>
  
  <pre><code>    E 21:59:53.098 Internal Server Error: /admin/
    Traceback (most recent call last):
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py", line 87, in get_response
        response = middleware_method(request)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/contrib/sessions/middleware.py", line 10, in process_request
        engine = import_module(settings.SESSION_ENGINE)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/contrib/sessions/backends/db.py", line 3, in &lt;module&gt;
        from django.db import IntegrityError, transaction, router
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/__init__.py", line 40, in &lt;module&gt;
        backend = load_backend(connection.settings_dict['ENGINE'])
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/__init__.py", line 34, in __getattr__
        return getattr(connections[DEFAULT_DB_ALIAS], item)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/utils.py", line 92, in __getitem__
        backend = load_backend(db['ENGINE'])
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/utils.py", line 24, in load_backend
        return import_module('.base', backend_name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/backends/mysql/base.py", line 16, in &lt;module&gt;
        raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
    ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
  E 21:59:53.227 Traceback (most recent call last):
      File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle
        result = handler(dict(self._environ), self._StartResponse)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/handlers/wsgi.py", line 241, in __call__
        response = self.get_response(request)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py", line 177, in get_response
        response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py", line 219, in handle_uncaught_exception
        return debug.technical_500_response(request, *exc_info)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/views/debug.py", line 66, in technical_500_response
        html = reporter.get_traceback_html()
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/views/debug.py", line 287, in get_traceback_html
        return t.render(c)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/base.py", line 140, in render
        return self._render(context)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/base.py", line 134, in _render
        return self.nodelist.render(context)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/base.py", line 823, in render
        bit = self.render_node(node, context)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/debug.py", line 74, in render_node
        return node.render(context)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/debug.py", line 84, in render
        output = self.filter_expression.resolve(context)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/base.py", line 599, in resolve
        new_obj = func(obj, *arg_vals)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/template/defaultfilters.py", line 718, in date
        return format(value, arg)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/dateformat.py", line 310, in format
        return df.format(format_string)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/dateformat.py", line 33, in format
        pieces.append(force_unicode(getattr(self, piece)()))
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/dateformat.py", line 214, in r
        return self.format('D, j M Y H:i:s O')
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/dateformat.py", line 33, in format
        pieces.append(force_unicode(getattr(self, piece)()))
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/encoding.py", line 71, in force_unicode
        s = unicode(s)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/functional.py", line 121, in __unicode_cast
        return func(*self.__args, **self.__kw)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/translation/__init__.py", line 86, in ugettext
        return _trans.ugettext(message)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/translation/trans_real.py", line 278, in ugettext
        return do_translate(message, 'ugettext')
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/translation/trans_real.py", line 268, in do_translate
        _default = translation(settings.LANGUAGE_CODE)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/translation/trans_real.py", line 183, in translation
        default_translation = _fetch(settings.LANGUAGE_CODE)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/translation/trans_real.py", line 160, in _fetch
        app = import_module(appname)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/contrib/admin/__init__.py", line 3, in &lt;module&gt;
        from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/contrib/admin/helpers.py", line 2, in &lt;module&gt;
        from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/contrib/admin/util.py", line 1, in &lt;module&gt;
        from django.db import models
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/__init__.py", line 40, in &lt;module&gt;
        backend = load_backend(connection.settings_dict['ENGINE'])
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/__init__.py", line 34, in __getattr__
        return getattr(connections[DEFAULT_DB_ALIAS], item)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/utils.py", line 92, in __getitem__
        backend = load_backend(db['ENGINE'])
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/utils.py", line 24, in load_backend
        return import_module('.base', backend_name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/importlib.py", line 35, in import_module
        __import__(name)
      File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/db/backends/mysql/base.py", line 16, in &lt;module&gt;
        raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
    ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
  </code></pre>
  
  <p>Relevant portions of settings.py:</p>
  
  <pre><code>import os
  
  DEBUG = True
  TEMPLATE_DEBUG = DEBUG
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  DATABASES = {
      'default': {
      'ENGINE': 'django.db.backends.mysql',
      'NAME': 'userinformation',
      'USER': 'root',
      'HOST': '/cloudsql/eloquent-ratio-109701:api-instance',
      }
  }
  
  TEMPLATE_LOADERS = (
      'django.template.loaders.filesystem.Loader',
      'django.template.loaders.app_directories.Loader',
      'django.template.loaders.eggs.Loader',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  ROOT_URLCONF = 'Chimera.urls'
  
  WSGI_APPLICATION = 'Chimera.wsgi.app'
  
  INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.sites',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.admin',
      'django.contrib.admindocs',
      'API',
  )
  </code></pre>
  
  <p>If you have any idea what could be going on, I'd really appreciate pointing me in the right direction. I can post any more significant source files here as well.</p>