can't find import: "google.golang.org/appengine"

960 views
Skip to first unread message

Robert Hancock

unread,
Apr 23, 2018, 9:43:34 AM4/23/18
to Google App Engine
GOPATH=/home/rwh/go

> ls /home/rwh/go/pkg/linux_amd64/google.golang.org/
appengine  appengine.a

> go version
go version go1.10 linux/amd64
> which go
/usr/local/go/bin/go

The sample hello application fails because it "can't find import: "google.golang.org/appengine"" Yet, this directory is under $GOPATH /pkg/linux_amd64/. Why is it not finding the import?

INFO     2018-04-22 23:08:56,689 devappserver2.py:120] Skipping SDK update check.
INFO     2018-04-22 23:08:56,806 api_server.py:274] Starting API server at: http://localhost:42969
INFO     2018-04-22 23:08:56,866 dispatcher.py:270] Starting module "default" running at: http://localhost:8080
INFO     2018-04-22 23:08:56,867 admin_server.py:152] Starting admin server at: http://localhost:8000
ERROR    2018-04-22 23:08:57,893 instance_factory.py:196] Failed to build Go application: (Executed command: /home/rwh/go/google-cloud-sdk/platform/google_appengine/goroot-1.8/bin/go-app-builder -app_base /home/rwh/go/src/github.com/GoogleCloudPlatform/golang-samples/appengine/helloworld -api_version go1 -arch 6 -dynamic -goroot /home/rwh/go/google-cloud-sdk/platform/google_appengine/goroot-1.8 -gopath /home/rwh/go/google-cloud-sdk/platform/google_appengine/gopath -nobuild_files ^^$ -incremental_rebuild -unsafe -binary_name _go_app -extra_imports appengine_internal/init -work_dir /tmp/tmpZPv2Osappengine-go-bin -gcflags -I,/home/rwh/go/google-cloud-sdk/platform/google_appengine/goroot-1.8/pkg/linux_amd64_appengine -ldflags -L,/home/rwh/go/google-cloud-sdk/platform/google_appengine/goroot-1.8/pkg/linux_amd64_appengine hello.go)
/tmp/tmpZPv2Osappengine-go-bin/hello.go:11: can't find import: "google.golang.org/appengine"

2018/04/22 19:08:57 Can't find package "google.golang.org/appengine" in $GOPATH: cannot find package "google.golang.org/appengine" in any of:
        /home/rwh/go/google-cloud-sdk/platform/google_appengine/goroot-1.8/src/google.golang.org/appengine (from $GOROOT)
        /home/rwh/go/google-cloud-sdk/platform/google_appengine/gopath/src/google.golang.org/appengine (from $GOPATH)
2018/04/22 19:08:57 go-app-builder: build timing: 0×skip (0s total), 1×compile (14ms total), 0×link (0s total)
2018/04/22 19:08:57 go-app-builder: failed running compile: exit status 2

Katayoon (Cloud Platform Support)

unread,
Apr 23, 2018, 4:13:01 PM4/23/18
to Google App Engine
I tried this tutorial and it works for me. I recommend that you upgrade your Cloud SDK by running “gcloud components update” and check to see if you have “app-engine-go” by running “gcloud components list”. If the issue persists, I recommend to report it via Issue Tracker since Google Groups are reserved for general product discussions and are not for reporting issues.

G. Capell

unread,
Jun 30, 2018, 8:11:31 PM6/30/18
to Google App Engine
In case anyone else goes down this track, I've reported this (or very similar) issue at https://issuetracker.google.com/issues/111017406
Reply all
Reply to author
Forward
0 new messages