Windows goapp服务:找不到dev_appserver.py
使用go 1.2 python 2.7和appengine 1.8.9Windows goapp服务:找不到dev_appserver.py,windows,google-app-engine,go,Windows,Google App Engine,Go,使用go 1.2 python 2.7和appengine 1.8.9 dev_appserver.py在dos框中工作,位于windows路径中 goapp.exe也可以在dos框中工作,并且位于windows路径中 你知道为什么goapp.exe serve不能工作吗?产生此错误消息的(“找不到dev_appserver.py”)显示以下代码: if p := os.Getenv("APPENGINE_DEV_APPSERVER"); p != "" { return p, nil }
dev_appserver.py
在dos框中工作,位于windows路径中
goapp.exe
也可以在dos框中工作,并且位于windows路径中
你知道为什么goapp.exe serve不能工作吗?产生此错误消息的(“找不到dev_appserver.py
”)显示以下代码:
if p := os.Getenv("APPENGINE_DEV_APPSERVER"); p != "" {
return p, nil
}
return "", fmt.Errorf("unable to find dev_appserver.py")
因此,在使用goapp时,请仔细检查是否实际设置了环境变量APPENGINE\u DEV\u APPSERVER
。例如,请参阅设置该变量的脚本
(但正确地说,您不应该直接设置它,您应该始终使用
goapp
):
Damit为什么他们不能将其包含在错误消息中:)“APPENGINE\u DEV\u APPSERVER env未正确设置”不设置APPENGINE\u DEV\u APPSERVER。使用SDK顶部的goapp,而不是goroot/bin下面的goapp。@dsymonds您是对的。我的意思不是让用户自己设置
APPENGINE\u DEV\u APPSERVER
,只是检查是否设置了它。我已经重新表述了答案,包括你的评论。
@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 %*