Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find package "github.com/pierrec/lz4/v3" during install #54

Closed
ngirardin opened this issue Dec 12, 2019 · 9 comments
Closed

Cannot find package "github.com/pierrec/lz4/v3" during install #54

ngirardin opened this issue Dec 12, 2019 · 9 comments

Comments

@ngirardin
Copy link

Hey guys,

I'm getting the following error that prevents me from installing timeliner:

go get -u github.com/mholt/timeliner/cmd/timeliner
package github.com/pierrec/lz4/v3: cannot find package "github.com/pierrec/lz4/v3" in any of:
        /usr/lib/go-1.10/src/github.com/pierrec/lz4/v3 (from $GOROOT)
        /home/ngirardin/go/src/github.com/pierrec/lz4/v3 (from $GOPATH)

Best,

Nicolas

@joonas-fi
Copy link
Contributor

Sounds like a duplicate of #49

From your error message (thanks for sharing it) I see you're running quite old version of Go (1.10). This project "requires" Go modules, which:

Go 1.11 and 1.12 include preliminary support for modules

Source: https://blog.golang.org/using-go-modules

Solution: update your Go version and try again?

@joonas-fi
Copy link
Contributor

Paging dr. @mholt: people (incl. me) have had difficulties getting the binary built.

I understand it's not a small task to get pre-built binaries automatically distributed, but in the meantime could we add to Installation section in README:

Minimum Go version:

@mholt
Copy link
Owner

mholt commented Dec 13, 2019

Sure. That's an easy solution.

@mholt mholt closed this as completed Dec 13, 2019
@ngirardin
Copy link
Author

Hi guys,

I've updated my Go version:

$ go version
go version go1.13.4 linux/amd64

But I can't still get the error when trying to download the package:

$ go get github.com/mholt/timeliner/cmd/timeliner
package github.com/pierrec/lz4/v3: cannot find package "github.com/pierrec/lz4/v3" in any of:
        /usr/lib/go-1.13/src/github.com/pierrec/lz4/v3 (from $GOROOT)
        /home/ngirardin/go/src/github.com/pierrec/lz4/v3 (from $GOPATH)

I don't have any experience with Go but I would be happy to help you setup a Github Action pipeline to create a binary / docker image.

Best,
Nicolas

@joonas-fi
Copy link
Contributor

You're right, it doesn't seem to work still with the $ go get command. The #49 I linked to fixed it for me because I did it by cloning + running the build command manually and even that didn't work befor that #49 fix. This seems to work (I tested just now):

$ git clone https://github.com/mholt/timeliner.git
$ cd timeliner/cmd/timeliner
$ go build

(I ran this inside a container by running $ docker run --rm -it golang:1.13.5-stretch bash)

Now there's a working binary in ./timeliner

There might be something different w.r.t. how Go handles the dependency (modules') fetching with go get vs. go build - dunno.

Setting up GitHub action pipeline to auto-build binaries sounds like a great idea - WDYT @mholt?

@mholt
Copy link
Owner

mholt commented Dec 25, 2019

Setting up GitHub action pipeline to auto-build binaries sounds like a great idea - WDYT @mholt?

Sure! ... how? 😅

You're right, it doesn't seem to work still with the $ go get command.

Ah... I forgot... so in Go 1.13, GO111MODULE is still "auto" by default, which in Go 1.13, means that you have to be in a folder (or subfolder) that has a go.mod file in order for modules to be enabled.

If you're installing the timeliner command, it's unlikely that that's the case. (But if you're in a Go project and you want to use timeliner as a library/dependency, then it probably is, but using timeliner as a library is not common...)

So simply do GO111MODULE=on go get ... and it works. (I just tested it with a blank GOPATH.)

This won't be needed in Go 1.14 onwards, I'm pretty sure.

Merry Christmas!

@kyprifog
Copy link

go version go1.14.1 darwin/amd64 and I still got this error.

@dankozlowski
Copy link

dankozlowski commented Oct 3, 2020

Also having this issue on 1.14.2.

@mholt
Copy link
Owner

mholt commented Oct 5, 2020

I am not really sure what is going on. Please read the above reply for the solution that is working for me. This should probably be taken up upstream in the lz4 repo instead: pierrec/lz4#62

Edit: Here's probably a more relevant issue in Go: golang/go#40276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants