首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >:无法导入Go软件包

:无法导入Go软件包
EN

Stack Overflow用户
提问于 2013-10-17 15:38:33
回答 1查看 1K关注 0票数 3

我正在尝试Google "hello“的例子,这个例子找到了这里。我正在使用Go语言,并严格遵循上述教程中给出的步骤.此外,我还使用安装程序这里安装了Go。我正在运行Windows7 x64。

在运行示例应用程序时,使用命令提示符:

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

我得到以下答复:

代码语言:javascript
复制
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)

除了最后一个temp文件夹之外,上面的所有路径似乎都是有效的(尽管我承认,我不知道其中任何一条路径的含义)。正如您在样本应用程序中看到的那样,fmt是第一个导入。如果我交换两个导入,则得到相同的错误,但对于net/http则是如此。

我知道Go是正确安装的,因为我可以运行下面的测试Go应用程序:

代码语言:javascript
复制
package main

import "fmt"

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

从...directly开始。

我尝试过处理所有不同的环境变量,但都没有结果。但是,看到测试Go应用程序将如何工作,我想这与something有关。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-18 00:44:58

最近发布的windows (1.8.6)中有一个bug。刚刚发布了一个较新的版本,修复了这个错误(1.8.6.1)。试着下载那个版本。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19431162

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档