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 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值