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" trying to run examples #17

Closed
cheshire137 opened this issue Dec 14, 2019 · 4 comments · Fixed by #20
Closed

"cannot find package" trying to run examples #17

cheshire137 opened this issue Dec 14, 2019 · 4 comments · Fixed by #20

Comments

@cheshire137
Copy link

Hi! I'm getting an error with each example I try to run:

Downloads/pixel-examples/typewriter at wonderland (master ✔)
% go run main.go
main.go:11:2: cannot find package "github.com/faiface/pixel" in any of:
	/usr/local/go/src/github.com/faiface/pixel (from $GOROOT)
	/Users/cheshire137/code/go/src/github.com/faiface/pixel (from $GOPATH)

I'm using macOS with:

% go version
go version go1.13.4 darwin/amd64

Do I need to clone faiface/pixel somewhere, or have a particular $GOROOT environment variable?

@scottlawsonbc
Copy link

If anyone else encounters this issue, here is how you can fix it. I'll use the platformer as an example.

In the platformer directory, run go mod init github.com/faiface/pixel-examples/platformer
The output should be go: creating new go.mod: module github.com/faiface/pixel-examples/platformer

Next run go build. When it finishes, you can run go run . to start the demo.

@vrecan
Copy link

vrecan commented Jul 5, 2020

would be nice if someone updated the repo to use go mod for all the examples

@willbeason
Copy link
Contributor

I've created #20 to resolve this. Since this repo doesn't get much traffic I'll post an issue in the main repository linking here.

@PawBud
Copy link

PawBud commented May 3, 2021

Screenshot from 2021-05-04 00-26-45
this is what I am getting, after trying out the "Creating a Window" Example and using #17 (comment)

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

Successfully merging a pull request may close this issue.

5 participants