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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果