去安装软件包/ usr / bin /不要去一个目录 [英] Go installing package /usr/bin/go not a directory

查看:156
本文介绍了去安装软件包/ usr / bin /不要去一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装一个Go软件包,但出现以下错误。

这是我的GOPATH

  p @ p-ubuntu:〜/ ba / docker -lvm-plugin $ echo $ GOPATH 
/ usr / bin / go

软件包安装

  p @ p-ubuntu:〜 / ba / docker-lvm-plugin $ go获取github.com/Sirupsen/logrus 
包github.com/Sirupsen/logrus:mkdir / usr / bin / go:不是目录


解决方案

你的GOPATH是错误的。它不应该是go二进制文件的路径,它应该是你的go项目目录的根目录的路径,它应该包含 src pkg bin 子目录。请参阅 GOPATH和GOROOT的价值是什么?


Im trying to install a Go package but having the following error.

Here is my GOPATH

p@p-ubuntu:~/ba/docker-lvm-plugin$ echo $GOPATH
/usr/bin/go

Package install

p@p-ubuntu:~/ba/docker-lvm-plugin$ go get github.com/Sirupsen/logrus
    package github.com/Sirupsen/logrus: mkdir /usr/bin/go: not a directory

解决方案

Your GOPATH is wrong. It should not be the path to the go binary, it should be the path to the root of your go project directory, which should contain src, pkg, and bin subdirectories. See what should be the values of GOPATH and GOROOT?

这篇关于去安装软件包/ usr / bin /不要去一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆