pxl
pxl copied to clipboard
command 'pxl' not found
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...
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.
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
@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.
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.
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.
@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'.