0

刚开始为 App Engine (Python) 设置。当我在上面运行任何应用程序时,http://localhost:8080我得到了这个:

--> --> -->


<type 'exceptions.RuntimeError'>    Python 2.5.2: E:\Python25\pythonw.exe
Tue Dec 25 13:40:46 2012

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in _HandleRequest(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance at 0x02F16DA0>)
 2999         outfile = cStringIO.StringIO()
 3000         try:
 3001           self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
 3002         finally:
 3003           self.module_manager.UpdateModuleFileModificationTimes()
self = <google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance at 0x02F16DA0>, self._Dispatch = <bound method DevAppServerRequestHandler._Dispat...vAppServerRequestHandler instance at 0x02F16DA0>>, dispatcher = <google.appengine.tools.dev_appserver.MatcherDispatcher object at 0x02F64870>, self.rfile = <socket._fileobject object at 0x02F18F30>, outfile = <cStringIO.StringO object at 0x02F64480>, env_dict = {'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...}
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in _Dispatch(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance at 0x02F16DA0>, dispatcher=<google.appengine.tools.dev_appserver.MatcherDispatcher object at 0x02F64870>, socket_infile=<socket._fileobject object at 0x02F18F30>, outfile=<cStringIO.StringO object at 0x02F64480>, env_dict={'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...})
 2868           dispatcher.Dispatch(app_server_request,
 2869                               outfile,
 2870                               base_env_dict=env_dict)
 2871         finally:
 2872           request_file.close()
base_env_dict undefined, env_dict = {'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...}
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in Dispatch(self=<google.appengine.tools.dev_appserver.MatcherDispatcher object at 0x02F64870>, request=<AppServerRequest relative_url: / path: main.app...mp', mode 'rb' at 0x0184C530> force_admin: False>, outfile=<cStringIO.StringO object at 0x02F64480>, base_env_dict={'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...})
  717         forward_request = dispatcher.Dispatch(request,
  718                                               outfile,
  719                                               base_env_dict=base_env_dict)
  720 
  721         while forward_request:
base_env_dict = {'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...}
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in Dispatch(self=<google.appengine.tools.dev_appserver.CGIDispatcher object at 0x02F64410>, request=<AppServerRequest relative_url: / path: main.app...mp', mode 'rb' at 0x0184C530> force_admin: False>, outfile=<cStringIO.StringO object at 0x02F64480>, base_env_dict={'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_ID_HASH': 'B6589FC6', 'REQUEST_METHOD': 'GET', 'SDK_VERSION': '1.7.4', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', ...})
 1801                      memory_file,
 1802                      outfile,
 1803                      self._module_dict)
 1804     finally:
 1805       logging.root.level = before_level
self = <google.appengine.tools.dev_appserver.CGIDispatcher object at 0x02F64410>, self._module_dict = {'__builtin__': <module '__builtin__' (built-in)>, 'cStringIO': <module 'cStringIO' (built-in)>, 'codecs': <module 'codecs' from 'E:\Python25\lib\codecs.pyc'>, 'decimal': <module 'decimal' from 'E:\Python25\lib\decimal.py'>, 'email': <module 'email' from 'E:\Python25\lib\email\__init__.py'>, 'email.Charset': <email.LazyImporter object at 0x0191AAB0>, 'email.Encoders': <email.LazyImporter object at 0x0191AB10>, 'email.Errors': <email.LazyImporter object at 0x0191AB30>, 'email.FeedParser': <email.LazyImporter object at 0x0191AA90>, 'email.Generator': <email.LazyImporter object at 0x0191AB70>, ...}
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in ExecuteCGI(config=<AppInfoExternal automatic_scaling=None ... runtime=python27 api_config=None >, root_path=r'J:\Tabrez\Projects\GAE\Python\bismillah', handler_path='main.app', cgi_path=r'J:\Tabrez\Projects\GAE\Python\bismillah\main.app', env={'APPENGINE_RUNTIME': 'python27', 'APPLICATION_ID': 'dev~bismillah', 'AUTH_DOMAIN': 'gmail.com', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'CURRENT_VERSION_ID': '1.1', 'DEFAULT_VERSION_HOSTNAME': 'localhost:8080', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', ...}, infile=<cStringIO.StringO object at 0x02F64820>, outfile=<cStringIO.StringO object at 0x02F64480>, module_dict={'__builtin__': <module '__builtin__' (built-in)>, 'cStringIO': <module 'cStringIO' (built-in)>, 'codecs': <module 'codecs' from 'E:\Python25\lib\codecs.pyc'>, 'decimal': <module 'decimal' from 'E:\Python25\lib\decimal.py'>, 'email': <module 'email' from 'E:\Python25\lib\email\__init__.py'>, 'email.Charset': <email.LazyImporter object at 0x0191AAB0>, 'email.Encoders': <email.LazyImporter object at 0x0191AB10>, 'email.Errors': <email.LazyImporter object at 0x0191AB30>, 'email.FeedParser': <email.LazyImporter object at 0x0191AA90>, 'email.Generator': <email.LazyImporter object at 0x0191AB70>, ...}, exec_script=<function ExecuteOrImportScript at 0x02F148F0>, exec_py27_handler=<function ExecutePy27Handler at 0x02F14930>)
 1699 
 1700       if handler_path and config and config.runtime == 'python27':
 1701         reset_modules = exec_py27_handler(config, handler_path, cgi_path, hook)
 1702       else:
 1703         reset_modules = exec_script(config, handler_path, cgi_path, hook)
reset_modules = True, exec_py27_handler = <function ExecutePy27Handler at 0x02F14930>, config = <AppInfoExternal automatic_scaling=None ... runtime=python27 api_config=None >, handler_path = 'main.app', cgi_path = r'J:\Tabrez\Projects\GAE\Python\bismillah\main.app', hook = <google.appengine.tools.dev_appserver_import_hook.HardenedModulesHook object at 0x02284F10>
 E:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py in ExecutePy27Handler(config=<AppInfoExternal automatic_scaling=None ... runtime=python27 api_config=None >, handler_path='main.app', cgi_path=r'J:\Tabrez\Projects\GAE\Python\bismillah\main.app', import_hook=<google.appengine.tools.dev_appserver_import_hook.HardenedModulesHook object at 0x02284F10>)
 1456   """
 1457   if request_environment is None or runtime is None:
 1458     raise RuntimeError('Python 2.5 is too old to emulate the Python 2.7 runtime.'
 1459                        ' Please use Python 2.6 or Python 2.7.')
 1460 
builtin RuntimeError = <type 'exceptions.RuntimeError'>

<type 'exceptions.RuntimeError'>: Python 2.5 is too old to emulate the Python 2.7 runtime. Please use Python 2.6 or Python 2.7.
      args = ('Python 2.5 is too old to emulate the Python 2.7 runtime. Please use Python 2.6 or Python 2.7.',)
      message = 'Python 2.5 is too old to emulate the Python 2.7 runtime. Please use Python 2.6 or Python 2.7.' 

据我了解,这只是 Python 安装的问题,因为应用程序在部署时运行良好。

我已经安装了 Python 2.5.2。

到底发生了什么?

4

1 回答 1

1

我从日志中假设原因是您正在尝试使用 python25 运行应用程序引擎。

选项 1:编辑您的 app.yaml 并将 python25 放在您的运行时。其余的你可以保留它,因为你已经设置好了

application: bismillah
version: 1
runtime: python25
api_version: 1

选项 2:安装 python 2.6 或 python 2.7 并将其设为您的系统默认值,或者仅将其用于谷歌应用引擎

蟒蛇 2.7

Google App Engine 应用程序设置

于 2012-12-25T14:36:28.327 回答