[beego]GOPATH 设置了,安装bee还是提示$GOPATH not set.

2023-12-21 388 views
7

➜ ~GOPATH sudo go get github.com/astaxie/bee package github.com/astaxie/bee: cannot download, $GOPATH not set. For more details see: go help gopath

➜ ~GOPATH go env GOARCH="amd64" GOBIN="" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/dyq/Workspace/go" GORACE="" GOROOT="/usr/local/Cellar/go/1.1.1" GOTOOLDIR="/usr/local/Cellar/go/1.1.1/pkg/tool/darwin_amd64" CC="gcc" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common" CGO_ENABLED="1"

求帮助,谢谢

回答

3

解决了..... PATH没设置对,这样就好了。 export PATH=$HOME/bin:$GOPATH/bin:$PATH

2

我也有这问题,执行export PATH=$HOME/bin:$GOPATH/bin:$PATH也不行啊。

1

我的也是,go env 都设置对了,还是会提示 not set gopath 求解呀

7

试试下面的:

export GOPATH=/var/www/html export PATH=$PATH:$GOPATH/bin

7

把你的path打印出来,在cd一下,有可能是你设置确实错了,个把空格字母都有可能