简体   繁体   English

Golang`go get`-在以下任何位置均找不到软件包

[英]Golang `go get` - Cannot find package in any of

I've followed this guide to install Go on Ubuntu 16.04. 我已按照本指南在Ubuntu 16.04上安装Go。 However, when I follow the installation instructions for a Go application ( go get github.com/src-d/enry/cmd/enry ), I get the following error: 但是,当我按照Go应用程序的安装说明进行操作go get github.com/src-d/enry/cmd/enry )时,出现以下错误:

package github.com/src-d/enry/v2: cannot find package "github.com/src-d/enry/v2" in any of:
        /usr/local/go/src/github.com/src-d/enry/v2 (from $GOROOT)
        /root/work/src/github.com/src-d/enry/v2 (from $GOPATH)
package github.com/src-d/enry/v2/data: cannot find package "github.com/src-d/enry/v2/data" in any of:
        /usr/local/go/src/github.com/src-d/enry/v2/data (from $GOROOT)
        /root/work/src/github.com/src-d/enry/v2/data (from $GOPATH)

Here's the output of go env : 这是go env的输出:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/work"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What am I doing wrong? 我究竟做错了什么?

Note: I have absolutely zero knowledge of how to program in Go, I'm just trying to install a CLI application. 注意:我对在Go中编程的知识绝对为零,我只是在尝试安装CLI应用程序。

Check the writable right of $GOPATH. 检查$ GOPATH的可写权限。 As you setting, it at /root 设置时,它位于/ root

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM