谷歌应用引擎dev_appserver.py错误

时间:2013-04-02 14:23:06

标签: python google-app-engine

在Ubuntu上使用dev_appserver.py在本地运行应用程序时出现此错误 它是由于python版本,因为它在python运行时文件中显示错误?
早些时候,同样的版本在Windows 8下工作。

INFO     2013-04-05 11:38:49,126 sdk_update_checker.py:244] Checking for updates to the SDK.
INFO     2013-04-05 11:38:49,648 sdk_update_checker.py:272] The SDK is up to date.
WARNING  2013-04-05 11:38:50,168 simple_search_stub.py:976] Could not read search indexes from /tmp/appengine.coderedsolution13.vjdhama/search_indexes
INFO     2013-04-05 11:38:50,170 api_server.py:152] Starting API server at: http://localhost:38393
INFO     2013-04-05 11:38:50,179 dispatcher.py:98] Starting server "default" running at: http://localhost:8080
INFO     2013-04-05 11:38:50,182 admin_server.py:117] Starting admin server at: http://localhost:8000
Traceback (most recent call last):
  File "/home/vjdhama/Documents/Softwares/google_appengine/_python_runtime.py", line 194, in <module>
    _run_file(__file__, globals())
  File "/home/vjdhama/Documents/Softwares/google_appengine/_python_runtime.py", line 190, in _run_file
    execfile(script_path, globals_)
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 101, in <module>
    main()
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 78, in main
    sandbox.enable_sandbox(config)
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 168, in enable_sandbox
    __import__('site')
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
ERROR    2013-04-05 11:38:50,677 http_runtime.py:221] unexpected port response from runtime ['']; exiting the development server
ERROR    2013-04-05 11:38:50,678 server.py:576] Request to '/_ah/warmup' failed
Traceback (most recent call last):
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/server.py", line 570, in _handle_request
    environ, wrapped_start_response)
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/request_rewriter.py", line 311, in _rewriter_middleware
    response_body = iter(application(environ, wrapped_start_response))
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/server.py", line 922, in _handle_script_request
    request_type)
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/server.py", line 887, in _handle_instance_request
    request_type)
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/instance.py", line 382, in handle
    request_type))
  File "/home/vjdhama/Documents/Softwares/google_appengine/google/appengine/tools/devappserver2/http_runtime.py", line 189, in handle
    self._port))
TypeError: %d format: a number is required, not NoneType
INFO     2013-04-05 11:38:50,710 server.py:528] "GET /_ah/warmup HTTP/1.1" 500 -
INFO     2013-04-05 11:38:51,193 api_server.py:517] Applying all pending transactions and saving the datastore
INFO     2013-04-05 11:38:51,193 api_server.py:520] Saving search indexes

2 个答案:

答案 0 :(得分:0)

在错误输出中,它说:

  

TypeError:%d format:需要一个数字,而不是NoneType

这可能意味着,您需要提供一个数字,而不是未分配的变量。

答案 1 :(得分:0)

我遇到了同样的问题。通过在文件夹_python_runtime.py

中的appengineSDK中创建~/bin/的符号链接来解决此问题。

像:

ln -s /wherever/sdks/google_appengine/_python_runtime.py /home/username/bin/