fogleman / primitive

Reproducing images with geometric primitives.
https://primitive.lol/
MIT License
12.35k stars 608 forks source link

Problems with setting up primitive #50

Open Joevanna opened 7 years ago

Joevanna commented 7 years ago

Hi!

I am trying to download and use primitive, but I am having some issues at the moment.. after I install Go (which is properly installed now) I run the command go get -u github.com/fogleman/primitive and I get this: error: cannot open .git/FETCH_HEAD: Permission denied package github.com/fogleman/primitive: exit status 1

I don't understand what I am doing wrong, is there anything I can do to use it?

Thanks a lot!

Gio

fogleman commented 7 years ago

That looks like a file system permissions problem.

go get will clone the repo at $GOPATH/src/github.com/fogleman/primitive which apparently you don't have permission to write.

Did you set a GOPATH? If not, it defaults to $HOME/go. Make sure this is writeable with your user account (I don't know why it wouldn't be, though).

AshleyMSherwood commented 7 years ago

Hello!

I'm having trouble with the install too, in a different way. I have installed Go, run the command go get -u github.com/fogleman/primitive and my command line seems to respond, because it goes blank for a few seconds, then back to the prompt, however when I try to run primitive -i ash.jpg -o output.svg -n 100 I get the error: bash: primitive: command not found

What could be wrong?

MC42 commented 7 years ago

@AshleyMSherwood to run primitive in the directory, you need to use ./ before your primitive command, as the binary is in whatever folder you are in. If you don't the computer assumes you're referring to an installed program, not the one sitting right in front of it.

fogleman commented 7 years ago

@AshleyMSherwood go get puts the binary in $GOPATH/bin, which needs to be on your PATH in order to run primitive from any directory.

david-jankoski commented 6 years ago

hey, i'm facing same issue...i installed go and added it to path (running go on cmd line from anywhere brings up the go help and usage page).
however when i run the go get ... command, cmd line freezes for some moments and unfreezes again without any output or info. i tried to search for primitive but nowhere to be found (command or any files).
i guess something goes silently wrong in the background...

i'm on win10 and would be glad to provide any additional help if needed. thank you for this excellent library and all your work!

edit: added a snapshot of what happens when using the verbose flag with go get
prim_err

david-jankoski commented 6 years ago

arghh - apologies. I've found the culprit.

So running the go get ... cmd (on win10 at least) installs primitive into the following path
C:/Users/USERNAME/go/bin/. The primitive binary sits there patiently waiting to be discovered :-)

sorry for the noise and thanks again! david

YanglabWCH commented 5 years ago

Hi Fogleman,

Have you closed this project? When I input go get -u github.com/fogleman/primitive, then it shows me this: image as you can see, the link cannot be fetched! actually, these links may be invalid~~

So could you give a help? Thanks a lot~~

Bests, Shisheng

fogleman commented 5 years ago

@qade544 Works for me:

➜  ~ go get -v -u github.com/fogleman/primitive
github.com/fogleman/primitive (download)
github.com/fogleman/gg (download)
github.com/golang/freetype (download)
Fetching https://golang.org/x/image/math/fixed?go-get=1
Parsing meta tags from https://golang.org/x/image/math/fixed?go-get=1 (status code 200)
get "golang.org/x/image/math/fixed": found meta tag get.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/math/fixed?go-get=1
get "golang.org/x/image/math/fixed": verifying non-authoritative meta tag
Fetching https://golang.org/x/image?go-get=1
Parsing meta tags from https://golang.org/x/image?go-get=1 (status code 200)
golang.org/x/image (download)
Fetching https://golang.org/x/image/font?go-get=1
Parsing meta tags from https://golang.org/x/image/font?go-get=1 (status code 200)
get "golang.org/x/image/font": found meta tag get.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/font?go-get=1
get "golang.org/x/image/font": verifying non-authoritative meta tag
Fetching https://golang.org/x/image/draw?go-get=1
Parsing meta tags from https://golang.org/x/image/draw?go-get=1 (status code 200)
get "golang.org/x/image/draw": found meta tag get.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/draw?go-get=1
get "golang.org/x/image/draw": verifying non-authoritative meta tag
Fetching https://golang.org/x/image/math/f64?go-get=1
Parsing meta tags from https://golang.org/x/image/math/f64?go-get=1 (status code 200)
get "golang.org/x/image/math/f64": found meta tag get.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/math/f64?go-get=1
get "golang.org/x/image/math/f64": verifying non-authoritative meta tag
Fetching https://golang.org/x/image/font/basicfont?go-get=1
Parsing meta tags from https://golang.org/x/image/font/basicfont?go-get=1 (status code 200)
get "golang.org/x/image/font/basicfont": found meta tag get.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/font/basicfont?go-get=1
get "golang.org/x/image/font/basicfont": verifying non-authoritative meta tag
github.com/nfnt/resize (download)
github.com/nfnt/resize
github.com/fogleman/primitive/primitive
github.com/fogleman/primitive
YanglabWCH commented 5 years ago

@fogleman Thanks a lot, Fogleman. If so, this may be the internet problem in China, So is there a local installation? not the online, then we can still use it~~ Thanks^_^

kikemunozj commented 4 years ago

Hi

Just in case someone gets to the same point. After installing go and primitive via go

I needed to do

export PATH=$PATH:$(go env GOPATH)/bin

so the primitive command works on any path (no need for ./)