chrissimpkins / Crunch

Insane(ly slow but wicked good) PNG image optimization
Other
3.36k stars 147 forks source link

/usr/bin/env: ‘python’: No such file or directory #91

Closed K0-RR closed 2 years ago

K0-RR commented 2 years ago

Describe the bug I get this when I try to run any crunch command image

Desktop (please complete the following information):

chrissimpkins commented 2 years ago

Do you see the same thing if you run /usr/bin/env python directly in the terminal? How about with /usr/bin/env python3?

As a temporary workaround, you can try calling the Python script with the Python interpreter instead of directly as a PATH installed command line executable. From repo root:

$ python src/crunch.py [options and args]
K0-RR commented 2 years ago

Workaround is working and /usr/bin/env python returns the same error but /usr/bin/env python3 works

chrissimpkins commented 2 years ago

In that case, I think that the fix will be to edit this line:

https://github.com/chrissimpkins/Crunch/blob/8e6e991760a31c01b8f1177c007dc9ed0fa68790/src/crunch.py#L1

to:

#!/usr/bin/env python3

and then re-install with the Makefile.

You should be able to use the crunch executable from the command line as you did in the original report following that change.

chrissimpkins commented 2 years ago

Did that work? If so, we should probably consider a move to release it like this. I think that python3 should be supported on target platforms. What distro are you using?

faimin commented 2 years ago

I cd to /Applications/Crunch.app/Contents/Resources/crunch.py, and update this script file env to #!/usr/bin/env python3 directly, it work.

OS: macOS Monterey 12.3 install crunch with homebrew