如何在Google App Engine开发服务器上使用第三方Go库?

In one of my .go files I have:

import (
  ...
  "github.com/stripe/stripe-go"
  "appengine"
  "appengine/datastore"
)

But when i run dev_appserver.py app.yaml I get the following error:

Can't find package "github.com/stripe/stripe-go" in $GOPATH

I've tried running go get github.com/stripe/stripe-go which I can see successfully installs to ~/go/src/github.com/stripe/stripe-go but the GAE dev server doesn't seem to look at that path for some reason.

gcloud app deploy works just fine, for what it's worth.

Got the same error while testing the import "github.com/stripe/stripe-go" and fixed it by following the steps here "EDIT":

export GOPATH=/home/user/go_project

And a sample.go file in the example app's directory contains the following import statement:

import (
  ...
  "github.com/stripe/stripe-go"
  "appengine"
  "appengine/datastore"
)

Then the gcloud tool will look for the "stripe/stripe-go" package in the following location when you run or deploy the app:

/home/user/go_project/src/stripe/stripe-go

Once the above is done, the devserver should look at the proper path after you've run "go get github.com/my_repo/packagename". hope it helps