influx-proxy icon indicating copy to clipboard operation
influx-proxy copied to clipboard

安装报错,求解

Open yushengme opened this issue 6 years ago • 31 comments

Shell 您好!

我按照 readme 中的安装步骤进行操作,到 go get -u github.com/shell909090/influx-proxy/service 这一步时,出现错误:

$ go get -u github.com/shell909090/influx-proxy/service package github.com/influxdata/influxdb/client/v2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of: /usr/lib/go/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT) /home/test/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)

我对 go 不太熟悉,请问遇到这种问题,应该如何处理?

谢谢您!

yushengme avatar Jan 19 '19 15:01 yushengme

你试试go get -u github.com/influxdata/influxdb/client/v2

shell909090 avatar Jan 19 '19 16:01 shell909090

$ go get -u github.com/influxdata/influxdb/client/v2 package github.com/influxdata/influxdb/client/v2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of: /usr/lib/go/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT) /home/ys/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)

还是报了同样的错误。。。

yushengme avatar Jan 20 '19 08:01 yushengme

不好意思,请稍等两天。昨天刚刚飞到北美,在调时差。调过来我看一下。很奇怪之前编译的时候没碰到这类问题。

shell909090 avatar Jan 21 '19 15:01 shell909090

相同的错误

ljhmily avatar Jan 23 '19 01:01 ljhmily

influx git主版本移除了client/v2的路径

ljhmily avatar Jan 23 '19 02:01 ljhmily

我还在倒时差。不过看到上面这句,倒是解释了为什么会出现这个问题。 这个问题暂时没法解决。原则上我们应该用vender去固定上游版本,但是和proxy相比influx上游实在太大了点。另一个办法是把相关的metric结构拷贝过来。或者,救急也可以删除metric相关代码。但是我现在都没有时间来处理,最快要等到Feb 15了。

shell909090 avatar Jan 23 '19 17:01 shell909090

我还在倒时差。不过看到上面这句,倒是解释了为什么会出现这个问题。 这个问题暂时没法解决。原则上我们应该用vender去固定上游版本,但是和proxy相比influx上游实在太大了点。另一个办法是把相关的metric结构拷贝过来。或者,救急也可以删除metric相关代码。但是我现在都没有时间来处理,最快要等到Feb 15了。

可以直接下载整个influxdb仓库, 并将版本切换到1.7, 然后本地编译安装

ljhmily avatar Jan 24 '19 07:01 ljhmily

这个问题还没解决吗

alisanguo avatar Feb 18 '19 05:02 alisanguo

没,这两天在倒腾docker升级...CVE...没法停...

shell909090 avatar Feb 18 '19 08:02 shell909090

@yushengme @ljhmily @alisanguo 我推了一个commit到dev分支上,麻烦测一下,看看有没有解决。

shell909090 avatar Feb 18 '19 17:02 shell909090

@shell909090 window下可以install linux报错如下: influx-proxy/service/main.go:16:2: cannot find package "gopkg.in/natefinch/lumberjack.v2" in any of: /usr/local/go/src/gopkg.in/natefinch/lumberjack.v2 (from $GOROOT) /app/go/src/gopkg.in/natefinch/lumberjack.v2 (from $GOPATH) influx-proxy/backend/config.go:14:2: cannot find package "gopkg.in/redis.v5" in any of: /usr/local/go/src/gopkg.in/redis.v5 (from $GOROOT) /app/go/src/gopkg.in/redis.v5 (from $GOPATH)

strongit avatar Feb 21 '19 02:02 strongit

@strongit 大哥,依赖没装。几天前改代码的时候,这几个依赖还是在的。您先装一下依赖。

shell909090 avatar Feb 21 '19 02:02 shell909090

@shell909090 嗯嗯 这台机器连不上网络,手动安装了下

strongit avatar Feb 21 '19 02:02 strongit

v1的client在这 "https://github.com/influxdata/influxdb1-client"

hardbone12 avatar Apr 10 '19 07:04 hardbone12

thx. BTW, dev版应该解决了这个问题

shell909090 avatar Apr 10 '19 07:04 shell909090

@shell909090 @strongit @ljhmily 移除代码中的还需要重新编译?

nmonz avatar May 07 '19 03:05 nmonz

shell909090 avatar May 07 '19 06:05 shell909090

@shell909090 那当前这个问题还只能通过修改代码来解决? 而且其中那些+和- 是指增加内容和删除内容?

nmonz avatar May 07 '19 06:05 nmonz

目前只有dev分支解决了这个问题。没有人回报测试通过前,我又不敢合并。

shell909090 avatar May 07 '19 07:05 shell909090

@shell909090 那在远程获取的时候(go get -u ),如何指定dev分支去获取呢?

nmonz avatar May 07 '19 07:05 nmonz

没办法,本地编译吧。 祈祷哪位好心人测试一下dev分支是不是稳定了。

shell909090 avatar May 10 '19 09:05 shell909090

@shell909090 那直接下载到本地 不用相关influxdb的东西吗?

nmonz avatar May 10 '19 09:05 nmonz

dev分支里移除了influxdb的相关依赖。redis等其他依赖不变。

shell909090 avatar May 10 '19 09:05 shell909090

我的安装到go get -u github.com/shell909090/influx-proxy/service这一步,直接就没反应,是什么情况,本地环境都有,github也能ping通,求指教

www6223166 avatar May 24 '19 12:05 www6223166

奇怪,应该报错啊。为啥没报错呢...

shell909090 avatar May 25 '19 12:05 shell909090

/root/go/src/github.com/shell909090/influx-proxy/monitor/metric.go:6:2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of: /local/gohome/go/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT) /root/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH) /root/go/src/github.com/shell909090/influx-proxy/service/main.go:16:2: cannot find package "gopkg.in/natefinch/lumberjack.v2" in any of: /local/gohome/go/src/gopkg.in/natefinch/lumberjack.v2 (from $GOROOT) /root/go/src/gopkg.in/natefinch/lumberjack.v2 (from $GOPATH) /root/go/src/github.com/shell909090/influx-proxy/backend/config.go:14:2: cannot find package "gopkg.in/redis.v5" in any of: /local/gohome/go/src/gopkg.in/redis.v5 (from $GOROOT) /root/go/src/gopkg.in/redis.v5 (from $GOPATH) 我也报这个错,1.7的下载下来的,如何安装啊,求指教

www6223166 avatar May 27 '19 03:05 www6223166

@www6223166 我看到你在另一个issue里面已经close了,没问题了么?

shell909090 avatar May 27 '19 12:05 shell909090

@shell909090 是的,我已经用上面那位老哥的方法把1.7下载到本地,编译解决了,但是遇到了新问题,我提了issue,麻烦看一下,万分感谢

www6223166 avatar May 28 '19 02:05 www6223166

https://github.com/influxdata/influxdb/issues/11035 问题还在 解决办法: go get - u github.com/influxdata/influxdb1-client (新的依赖地址) go get -u github.com/shell909090/influx-proxy/service 报错之后 找到(go env)$GOPATH/src/github.com/shell909090/influx-proxy/monitor/metric.go 修改为 client "github.com/influxdata/influxdb1-client/v2" 到$GOPATH/src/github.com/shell909090/influx-proxy/service目录 go install 然后步骤就顺了

lxy597 avatar Jul 25 '19 03:07 lxy597

influxdata/influxdb#11035 问题还在 解决办法: go get - u github.com/influxdata/influxdb1-client (新的依赖地址) go get -u github.com/shell909090/influx-proxy/service 报错之后 找到(go env)$GOPATH/src/github.com/shell909090/influx-proxy/monitor/metric.go 修改为 client "github.com/influxdata/influxdb1-client/v2" 到$GOPATH/src/github.com/shell909090/influx-proxy/service目录 go install 然后步骤就顺了

我按照您的步骤执行了。 后面出现了这个 [root@master service]# go install main.go:16:2: cannot find package "gopkg.in/natefinch/lumberjack.v2" in any of: /data/go/src/gopkg.in/natefinch/lumberjack.v2 (from $GOROOT) /data/gopath/src/gopkg.in/natefinch/lumberjack.v2 (from $GOPATH) ../backend/config.go:14:2: cannot find package "gopkg.in/redis.v5" in any of: /data/go/src/gopkg.in/redis.v5 (from $GOROOT) /data/gopath/src/gopkg.in/redis.v5 (from $GOPATH) 我没弄过go 这样是少了包吗 我需要在哪里安装?

zhangyang1995 avatar Oct 29 '20 03:10 zhangyang1995