doushi4795 2018-04-11 12:27
浏览 35

即使配置了GOPTH,也无法下载fabric-sdk-go

I am a newbie in GOlang and Hyperledger fabric, I was just configuring the environment. But I got a weird error that is given bellow

 user1@NTP-145UBUNTU:~$ go env
 GOARCH="amd64"
 GOBIN=""
 GOEXE=""
 GOHOSTARCH="amd64"
 GOHOSTOS="linux"
 GOOS="linux"
 GOPATH="/usr/lib/go-1.6/bin"
 GORACE=""
 GOROOT="/usr/lib/go-1.6"
 GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
 GO15VENDOREXPERIMENT="1"
 CC="gcc"
 GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
 CXX="g++"
 CGO_ENABLED="1"
 user1@NTP-145UBUNTU:~$ sudo go get -u github.com/hyperledger/fabric-sdk-go
 [sudo] password for user1: 
 package github.com/hyperledger/fabric-sdk-go: cannot download, $GOPATH not set. For more details see: go help gopath

It is saying that my GOPATH env variable is not set. I have configured it and its is showing in evn variable list also. If anyone in here faced this issue please help me. please note : I am using ubuntu 16 LTS

thanks in advance.

  • 写回答

3条回答 默认 最新

  • dsyk33753 2018-04-11 12:37
    关注

    You are executing go get with sudo. That will cause all your env variables to be lost, as the command gets executed as user root.

    Usually this should not be necessary. $GOPATH is usually set to $HOME/go/. This is also the default value. You should set $GOPATH to this value. After that you do not have to call go get with sudo.

    And as pizza lord suggested, you should update your go version.

    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀