duancongduo4109
2013-10-17 15:38
浏览 66
已采纳

Google App Engine:无法导入Go软件包

I'm attempting the Google App Engine "hello world" example found here. I'm using the Go language, and following exactly the steps given in the above-mentioned tutorial. Additionally, I've installed Go using the installer here. I'm running Windows 7 x64.

When I run the sample app, using the command prompt:

dev_appserver.py c:\@Code\Go\myapp

I get the following response:

INFO     2013-10-17 11:17:00,497 sdk_update_checker.py:245] Checking for updates
 to the SDK.
INFO     2013-10-17 11:17:02,756 sdk_update_checker.py:273] The SDK is up to dat
e.
WARNING  2013-10-17 11:17:02,815 api_server.py:332] Could not initialize images
API; you are likely missing the Python "PIL" module.
INFO     2013-10-17 11:17:02,828 api_server.py:139] Starting API server at: http
://localhost:53563
INFO     2013-10-17 11:17:02,834 dispatcher.py:171] Starting module "default" ru
nning at: http://localhost:8080
INFO     2013-10-17 11:17:02,838 admin_server.py:117] Starting admin server at:
http://localhost:8000
ERROR    2013-10-17 11:17:02,905 go_runtime.py:165] Failed to build Go applicati
on: c:\@Code\Go\myapp\hello\hello.go:4: can't find import: "fmt"

2013/10/17 11:17:02 go-app-builder: build timing: 1×6g (16ms total), 0×gopack
(0 total), 0×6l (0 total)
2013/10/17 11:17:02 go-app-builder: failed running 6g.exe: exit status 1


(Executed command: C:\go_appengine\goroot\bin\go-app-builder.exe -app_base c:\@C
ode\Go\myapp -arch 6 -binary_name _go_app -dynamic -extra_imports appengine_inte
rnal/init -goroot C:\go_appengine\goroot -gcflags -I=C:\go_appengine\goroot\pkg\
windows_amd64_appengine -ldflags -L=C:\go_appengine\goroot\pkg\windows_amd64_app
engine -nobuild_files ^^$ -unsafe -work_dir c:\users\dennyc~1.sun\appdata\local\
temp\tmpr5dxl2appengine-go-bin hello\hello.go)

All of the paths above seem to be valid (although admittedly I don't know what any of them mean) with the exception of the last temp folder. As you can see in the sample app, fmt is the first import. If I swap the two imports, I get the same error but for net/http.

I know Go is properly installed because I can run the following test Go app:

package main

import "fmt"

func main() {
    fmt.Printf("hello, world
")
}

...directly from Go.

I've tried messing with all of the various Environment Variables at no avail. But, seeing as to how the test Go app will work, I'm thinking this has something to do with the App Engine.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douchuang4181 2013-10-18 00:44
    已采纳

    There was a bug in the recently released windows SDK (1.8.6). A newer version has just been released which fixes that bug (1.8.6.1). Try downloading that version instead. https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go

    点赞 评论

相关推荐 更多相似问题