1

在 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
4

2 回答 2

0

在您的错误输出中它说:

类型错误:%d 格式:需要一个数字,而不是 NoneType

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

于 2013-04-05T13:22:01.927 回答
0

我有同样的问题。_python_runtime.py它是通过在文件夹中的 appengineSDK 中创建符号链接来修复的~/bin/

喜欢:

ln -s /wherever/sdks/google_appengine/_python_runtime.py /home/username/bin/
于 2013-04-13T12:24:42.513 回答