无法使用Go正确获取

时间:2016-06-11 05:15:42

标签: go

我是新用户,我正在尝试此命令。

go get github.com/tensorflow/tensorflow/tensorflow/contrib/go

我收到此错误

package github.com/tensorflow/tensorflow/tensorflow/contrib/go
    imports github.com/tensorflow/tensorflow/tensorflow/contrib/go
    imports github.com/tensorflow/tensorflow/tensorflow/contrib/go: cannot find package "github.com/tensorflow/tensorflow/tensorflow/contrib/go" in any of:
    /usr/lib/go/src/pkg/github.com/tensorflow/tensorflow/tensorflow/contrib/go (from $GOROOT)
    /home/arafat/go/src/github.com/tensorflow/tensorflow/tensorflow/contrib/go (from $GOPATH)

我知道这似乎是一个微不足道的问题,但我坚持不懈。

1 个答案:

答案 0 :(得分:1)

如果要编译和安装的代码在master分支中不是(默认情况下由go get检出),而是only in the go branch of that repo,请尝试和:

cd $GOPATH/github.com/tensorflow/tensorflow
git checkout go

然后再次尝试编译。