How do I find where Python is located on Unix?
For this very reason it is recommend that you change your shebang line to be more path agnostic:
#!/usr/bin/env python
See this mailing list message for more information:
Consider the possiblities that in a different machine, python may be installed at
/usr/bin/python
or/bin/python
in those cases,#!/usr/local/bin/python
will fail. For those cases, we get to call theenv
executable with argument which will determine the arguments path by searching in the$PATH
and use it correctly.(
env
is almost always located in/usr/bin/
so one need not worry thatenv
is not present at/usr/bin
.)