title: The rdbms API is not available because the MySQLdb library could not be loaded
body: <p>I tried to debug google-app-engine application with local Mysql, because after some coding then deploy it to google-app-engine, visit the website, then check the log from the app engine console's log, it takes quite a lot of time and not convenient. But after i install Mysql and mysql-python, there is always a problem, and i check the internet, there are quite a lot old posts discussing this kind of similar problem, but none can solve my problem.</p>
  
  <p>My develop environment: </p>
  
  <pre><code> Mac 10.7.3, App-Engine 1.6.4, Python 2.7.1,  Mysql  5.5.23 
  </code></pre>
  
  <p>Launch the app-engine develop server and log:</p>
  
  <pre><code>INFO     2012-04-18 08:45:36,212 py_zipimport.py:148] zipimporter('/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg', 'MySQLdb/')
  WARNING  2012-04-18 08:45:36,350 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
  
  INFO     2012-04-18 08:45:36,484 appengine_rpc.py:160] Server: appengine.google.com
  INFO     2012-04-18 08:45:36,488 appcfg.py:582] Checking for updates to the SDK.
  DEBUG    2012-04-18 08:45:36,490 appengine_rpc.py:365] Sending HTTPS request:
  POST /api/updatecheck?release=1.6.4&amp;timestamp=1330713524&amp;runtime=python27&amp;api_versions=%5B%271%27%5D HTTPS/1.1
  Host: appengine.google.com
  X-appcfg-api-version: 1
  Content-type: application/octet-stream
  User-agent: appcfg_py/1.6.4 Darwin/11.3.0 Python/2.7.1.final.0
  
  
  INFO     2012-04-18 08:45:38,001 appcfg.py:616] This SDK release is newer than the advertised release.
  INFO     2012-04-18 08:45:38,075 dev_appserver_multiprocess.py:647] Running application dev~myapp on port 8080: http://localhost:8080
  INFO     2012-04-18 08:45:38,076 dev_appserver_multiprocess.py:649] Admin console is available at: http://localhost:8080/_ah/admin
  </code></pre>
  
  <p>visit <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a>, and log:</p>
  
  <pre><code>DEBUG    2012-04-18 08:48:19,608 dev_appserver.py:656] Matched "/" to CGI dispatcher with path main.app
  DEBUG    2012-04-18 08:48:19,622 dev_appserver.py:1624] Executing CGI with env:
  {'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_CONNECTION': 'keep-alive', '_AH_THREADSAFE': '1', 'REQUEST_ID_HASH': 'B6589FC6', 'CURRENT_VERSION_ID': '1.1', 'SERVER_SOFTWARE': 'Development/1.0', 'SCRIPT_NAME': '', 'USER_ORGANIZATION': '', 'REQUEST_METHOD': 'GET', 'HTTP_HOST': 'localhost:8080', 'PATH_INFO': '/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': '', 'TZ': 'UTC', 'USER_EMAIL': '', 'CONTENT_LENGTH': '', 'USER_ID': '', 'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~myapp', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3', 'SERVER_NAME': 'localhost', 'REMOTE_ADDR': '127.0.0.1', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT_LANGUAGE': 'en-us', 'SDK_VERSION': '1.6.4', 'PATH_TRANSLATED': '/Users/Dajie/Workspace/Python/myapp/main.app', 'SERVER_PORT': '8080', '_AH_ENCODED_SCRIPT_NAME': '/', 'AUTH_DOMAIN': 'gmail.com'}
  WARNING  2012-04-18 08:48:19,625 py_zipimport.py:139] Can't open zipfile /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg: IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg'
  WARNING  2012-04-18 08:48:19,626 py_zipimport.py:139] Can't open zipfile /Library/Python/2.7/site-packages/WebOb-1.2b3-py2.7.egg: IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/WebOb-1.2b3-py2.7.egg'
  ERROR    2012-04-18 08:48:19,863 wsgi.py:189] 
  Traceback (most recent call last):
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 187, in Handle
      handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler
      handler = __import__(path[0])
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1850, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
      description)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
      description)
    File "/Users/Dajie/Workspace/Python/myapp/main.py", line 22, in &lt;module&gt;
      import MySQLdb
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1850, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
      description)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 676, in Decorate
      return func(self, *args, **kwargs)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1647, in LoadModuleRestricted
      return source_file.load_module(submodule_fullname)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 246, in load_module
      submodname, is_package, fullpath, source = self._get_source(fullmodname)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 207, in _get_source
      source = self.zipfile.read(relpath.replace(os.sep, '/'))
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 867, in read
      return self.open(name, "r", pwd).read()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 882, in open
      zef_file = open(self.filename, 'rb')
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 592, in __init__
      raise IOError(errno.EACCES, 'file not accessible', filename)
  IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg'
  INFO     2012-04-18 08:48:19,882 dev_appserver.py:2884] "GET / HTTP/1.1" 500 -
  </code></pre>
  
  <p>Anyone knows how to fix this problem, thanx a lot.</p>