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

Installation cannot find packages #2

Open
lacker opened this issue Feb 4, 2021 · 1 comment
Open

Installation cannot find packages #2

lacker opened this issue Feb 4, 2021 · 1 comment

Comments

@lacker
Copy link

lacker commented Feb 4, 2021

I might just be misunderstanding some basic gopath type thing, but I run into errors when attempting to follow the installation instructions:

$ go install cmd/pcp/pcp.go
cmd/pcp/pcp.go:9:2: cannot find package "github.com/dennis-tra/pcp/internal/log" in any of:
	/usr/lib/go-1.10/src/github.com/dennis-tra/pcp/internal/log (from $GOROOT)
	/home/lacker/go/src/github.com/dennis-tra/pcp/internal/log (from $GOPATH)
cmd/pcp/pcp.go:10:2: cannot find package "github.com/dennis-tra/pcp/pkg/initialize" in any of:
	/usr/lib/go-1.10/src/github.com/dennis-tra/pcp/pkg/initialize (from $GOROOT)
	/home/lacker/go/src/github.com/dennis-tra/pcp/pkg/initialize (from $GOPATH)
cmd/pcp/pcp.go:11:2: cannot find package "github.com/dennis-tra/pcp/pkg/receive" in any of:
	/usr/lib/go-1.10/src/github.com/dennis-tra/pcp/pkg/receive (from $GOROOT)
	/home/lacker/go/src/github.com/dennis-tra/pcp/pkg/receive (from $GOPATH)
cmd/pcp/pcp.go:12:2: cannot find package "github.com/dennis-tra/pcp/pkg/send" in any of:
	/usr/lib/go-1.10/src/github.com/dennis-tra/pcp/pkg/send (from $GOROOT)
	/home/lacker/go/src/github.com/dennis-tra/pcp/pkg/send (from $GOPATH)
cmd/pcp/pcp.go:7:2: cannot find package "github.com/urfave/cli/v2" in any of:
	/usr/lib/go-1.10/src/github.com/urfave/cli/v2 (from $GOROOT)
	/home/lacker/go/src/github.com/urfave/cli/v2 (from $GOPATH)
@dennis-tra
Copy link
Owner

dennis-tra commented Feb 4, 2021

Hi @lacker, cool that you're checking out the tool!

It looks like you're using Go 1.10 (at least it says go-1.10 in the paths). This Go version doesn't support Go modules yet, which I'm using for dependency management.

I could reproduce your issue with:

$ docker run --rm -it golang:1.10 bash
$ git clone https://github.com/dennis-tra/pcp.git
$ cd pcp && go install cmd/pcp/pcp.go
cmd/pcp/pcp.go:9:2: cannot find package "github.com/dennis-tra/pcp/internal/log" in any of:
	/usr/local/go/src/github.com/dennis-tra/pcp/internal/log (from $GOROOT)
	/go/src/github.com/dennis-tra/pcp/internal/log (from $GOPATH)
cmd/pcp/pcp.go:10:2: cannot find package "github.com/dennis-tra/pcp/pkg/initialize" in any of:
	/usr/local/go/src/github.com/dennis-tra/pcp/pkg/initialize (from $GOROOT)
	/go/src/github.com/dennis-tra/pcp/pkg/initialize (from $GOPATH)
cmd/pcp/pcp.go:11:2: cannot find package "github.com/dennis-tra/pcp/pkg/receive" in any of:
	/usr/local/go/src/github.com/dennis-tra/pcp/pkg/receive (from $GOROOT)
	/go/src/github.com/dennis-tra/pcp/pkg/receive (from $GOPATH)
cmd/pcp/pcp.go:12:2: cannot find package "github.com/dennis-tra/pcp/pkg/send" in any of:
	/usr/local/go/src/github.com/dennis-tra/pcp/pkg/send (from $GOROOT)
	/go/src/github.com/dennis-tra/pcp/pkg/send (from $GOPATH)
cmd/pcp/pcp.go:7:2: cannot find package "github.com/urfave/cli/v2" in any of:
	/usr/local/go/src/github.com/urfave/cli/v2 (from $GOROOT)
	/go/src/github.com/urfave/cli/v2 (from $GOPATH)

So I'm afraid that I can only recommend upgrading to a newer Go version 😕 Personally I'm using the latest Go 1.15.6:

$ go version
go version go1.15.6 darwin/amd64

Unfortunately I don't know the minimum Go version I'm supporting yet. It may work with Go 1.13.

The other thing is that I just added the option to downlod pre-built executables from the release page. If you're on macOS Catalina or later though, there may be notarization issues, so compiling it yourself may actually be the easier option.

EDIT: Compilation works when using the golang:1.13 Docker image. golang:1.12 does not work.

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

2 participants