使用Google App engine,dev_appserver出现问题

BugScanner 发布于 2013/11/08 06:25
阅读 1K+
收藏 0

第一次使用Google App engine SDK for Python, 想运行Hello World, 但是安装后出现了根据google官网上提供的代码运行出现了问题,在网上搜了很长时间,还是没找到答案,helloworld.py 和app.yaml如下


#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import webapp2

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.write('Hello world!')

app = webapp2.WSGIApplication([
    ('/', MainHandler)
], debug=True)
application: MyFirstApp
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /.*
  script: helloworld.application
log日志:


2013-11-07 22:20:34 Running command: "[u'D:\\Programme Files\\Python\\pythonw.exe', u'D:\\Programme Files\\Google Apps Engine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8081', '--admin_port=8111', 'E:\\workspace\\Google_App_Engine\\MyFirstApp']"

Traceback (most recent call last):

  File "D:\Programme Files\Google Apps Engine\dev_appserver.py", line 197, in <module>

    _run_file(__file__, globals())

  File "D:\Programme Files\Google Apps Engine\dev_appserver.py", line 193, in _run_file

    execfile(script_path, globals_)

  File "D:\Programme Files\Google Apps Engine\google\appengine\tools\devappserver2\devappserver2.py", line 20, in <module>

    import argparse

  File "D:\Programme Files\Python\lib\argparse.py", line 85, in <module>

    import collections as _collections

  File "D:\Programme Files\Python\lib\collections\__init__.py", line 367

    exec(class_definition, namespace)

SyntaxError: unqualified exec is not allowed in function 'namedtuple' it contains a nested function with free variables

2013-11-07 22:20:34 (Process exited with code 1)


跪求大神指教,俺在线等……

加载中
返回顶部
顶部