设置Google App Engine SDK - 不运行应用

时间:2011-02-06 00:35:48

标签: python google-app-engine

根据Google的说明设置Python Google App Engine SDK后,我在启动器中运行示例留言板应用程序并在日志中获取以下内容:

2011-02-05 18:32:23 Running command: "[u'C:\\Python25\\pythonw.exe', 'C:\\Program    Files\\Google\\google_appengine\\dev_appserver.py', '--admin_console_server=', '--   port=8080', u'C:\\Program Files\\Google\\google_appengine\\demos\\guestbook']"
WARNING  2011-02-06 00:32:24,798 datastore_file_stub.py:573] Could not read datastore data from c:\users\austin\appdata\local\temp\dev_appserver.datastore
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 52, in <module>
    run_file(__file__, globals())
  File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 48, in run_file
    execfile(script_path, globals_)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 503, in <module>
    sys.exit(main(sys.argv))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 480, in main
    static_caching=static_caching)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3881, in CreateServer
    server = HTTPServerWithScheduler((serve_address, port), handler_class)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3901, in __init__
    request_handler_class)
  File "C:\Python25\lib\SocketServer.py", line 330, in __init__
    self.server_bind()
  File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "C:\Python25\lib\SocketServer.py", line 341, in server_bind
    self.socket.bind(self.server_address)
  File "<string>", line 1, in bind
socket.gaierror: (11004, 'getaddrinfo failed')
2011-02-05 18:32:25 (Process exited with code 1)

我该怎么做才能解决这个问题?我完全没有使用Python的经验。

2 个答案:

答案 0 :(得分:2)

尝试使用其他端口:

  1. 在Google App Engine Launcher中,点击一下您的应用
  2. 从菜单中选择Edit | Application Settings
  3. 将端口号从8080更改为8888
  4. Screenshot of settings

    如果您想查看使用特定端口的内容,请从管理命令提示符运行netstat -a -b

    这也可能是一个相关问题:How to fix socket.gaierror: (11004, 'getaddrinfo failed') error in GAE?

答案 1 :(得分:0)

socket.gaierror与您的网络有关。您是否在使用计算机的主机名,是否未映射到127.0.0.1?在applauncher(它只是Windows功能)中,您是否看到可以设置地址运行的位置,如果是,您可以直接使用localhost或IP(如127.0.0.1)。还要确保默认端口8080不被防火墙阻止或被其他端口占用。