doudou1309 2014-01-18 00:42
浏览 58
已采纳

goapp服务:找不到dev_appserver.py

using go 1.2 python 2.7 and appengine 1.8.9

dev_appserver.py works in dos box and is located in windows path.

goapp.exe also works in dos box and is located in windows path.

Any idea why goapp.exe serve does not work?

  • 写回答

1条回答 默认 最新

  • drbmhd9583 2014-01-19 10:09
    关注

    The goapp/serve.go which produces this error message ("unable to find dev_appserver.py") shows the following code:

    if p := os.Getenv("APPENGINE_DEV_APPSERVER"); p != "" {
      return p, nil
    }
    return "", fmt.Errorf("unable to find dev_appserver.py")
    

    So double-check if, when using goapp, APPENGINE_DEV_APPSERVER environment variable was actually set.
    See for instance this gotool.bat script which does set that variable
    (but dsymonds rightly points out that you should not set it directly, you should always use goapp):

    @echo off
    :: Copyright 2012 Google Inc. All rights reserved.
    :: Use of this source code is governed by the Apache 2.0
    :: license that can be found in the LICENSE file.
    setlocal
    set GOROOT=%~dp0\goroot
    set APPENGINE_DEV_APPSERVER=%~dp0\dev_appserver.py
    set GOARCH=
    set GOBIN=
    set GOOS=
    
    :: Set a GOPATH if one is not set.
    if not "%GOPATH%"=="" goto havepath
    set GOPATH=%~dp0\gopath
    :havepath
    
    %GOROOT%\bin\%~n0.exe %*
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?