Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

goapp serve: unable to find 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?

like image 287
Gert Cuykens Avatar asked Oct 01 '22 20:10

Gert Cuykens


1 Answers

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 %*
like image 105
VonC Avatar answered Oct 13 '22 11:10

VonC