1
python 
Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb

命令行上的一切都很顺利,但我仍然在 appengine 日志中得到以下信息

*** Running dev_appserver with the following flags:
    --admin_console_server= --port=8080
Python command: /usr/bin/python2.7
INFO     2012-08-03 14:15:31,002 py_zipimport.py:148] zipimporter('/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.8-intel.egg', 'MySQLdb/')
WARNING  2012-08-03 14:15:31,096 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
WARNING  2012-08-03 14:15:31,183 datastore_file_stub.py:518] Could not read datastore data from /var/folders/mc/45jr0vk5217fmpl18jn3vgx40000gn/T/dev_appserver.datastore
WARNING  2012-08-03 14:15:31,188 dev_appserver.py:3498] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
INFO     2012-08-03 14:15:31,194 dev_appserver_multiprocess.py:647] Running application dev~appexp87 on port 8080: http://localhost:8080
INFO     2012-08-03 14:15:31,194 dev_appserver_multiprocess.py:649] Admin console is available at: http://localhost:8080/_ah/admin
4

2 回答 2

2

您是否尝试使用 CloudSQL?如果没有,请不要担心 rdbms API 警告,该行是无害的。PIL警告也是如此。

不过,您不应该收到关于无法读取数据存储文件的警告。这可能是文件权限的问题,或者文件可能以某种方式损坏。如果他们的数据不是必需的,请尝试清除数据存储文件并重试。

于 2012-08-03T14:38:27.537 回答
0

如果您还没有这样做,请将此行添加import MySQLdb到文件中。dev_appserver.py

于 2013-03-04T06:34:58.273 回答