pxl icon indicating copy to clipboard operation
pxl copied to clipboard

command 'pxl' not found

Open aderchox opened this issue 5 years ago • 6 comments

I have GO installed and running and configured in the PATH as well. I run this: go get github.com/ichinaski/pxl It gives no error, by which I assume it's gotten installed fine without any errors(?). Then I run this: pxl path/to/image And I get this error: Command "pxl" not found, did you mean...

aderchox avatar Jul 10 '19 15:07 aderchox

Old question but I experienced this issue as well. I needed to reference the whole path to the pxl binary - ../go/bin/pxl. Otherwise you could add the binary to your PATH.

lachlanallison avatar Jan 30 '20 07:01 lachlanallison

Old question but I experienced this issue as well. I needed to reference the whole path to the pxl binary - ../go/bin/pxl. Otherwise you could add the binary to your PATH.

@lachlanallison could you please explain this? I have the issue as well

ghost avatar Feb 09 '20 19:02 ghost

@Myythaar when I did go get github.com/ichinaski/pxl it created a folder structure ../go/bin/pxl. To run pxl I had to either go into that subdirectory, reference the whole path (../go/bin/pxl filename) or add it to the PATH variables.

lachlanallison avatar Feb 14 '20 06:02 lachlanallison

Just to clarify, as I just ran into this, when you run go get|install it puts these in a directory in your home directory. So, adding something like export PATH=$HOME/go/bin/:$PATH to your .bashrc or .zshrc should fix the issue and make the program accessible.

brakkum avatar May 01 '21 16:05 brakkum

This (installing to $GOPATH/bin/) is standard Go behaviour. If you intend to use Go more more than just building/installing this one tool I'd recommend reading some of the Go documentation, e.g. How to Write Go Code where it mentions GOPATH and GOBIN and, in passing, setting your $PATH.

Alternatively, if you just care about building this one program and putting it somewhere you want you could do something like this (assuming you have a Go1.11+ module aware installation):

env GOBIN=/tmp go install github.com/ichinaski/pxl@latest

Where GOBIN is set to some directory where you want it installed.

I'd say that even though the README for this repository doesn't mention modules this isn't an issue since it does say: "You will need to have Go installed and configured in your path." Perhaps the README could be adjusted with the information/links I give above.

dchapes avatar May 09 '21 12:05 dchapes

@aderchox You can run with below a few lines from forked/updated repo:

git clone https://github.com/dchapes/pxl.git
cd pxl
go build cmd/pxl/main.go

# you can see main binary file
./main -h
Usage: ./pxl <filename>...

Close the image with <ESC> or by pressing 'q'.

bieli avatar Oct 03 '23 18:10 bieli