On Fri, Jul 01, 2016 at 12:37:55PM +0200, Michael Olbrich wrote:
> Can you try '#!/usr/bin/env python'? That should work too.

That won't work, because the problem is not the path itself, it's that
python is symlinked to python3 on Arch and probably in the future in
other distros as well. Arch is just a little ahead.

/usr/bin/env python --version returns "Python 3.5.1" on ArchLinux.

We could use /usr/bin/env python2 but that would only be good for
systems where python2 is not in /usr/bin but that does not seem to be
the problem.
A python2 symlink exists also on Debian, so /usr/bin/python2 should work
for most systems.

Otherwise we would need a logic like the following:

#!/bin/sh
''':'
if type python2 >/dev/null 2>/dev/null; then
  exec python2 "$0" "$@"
else
  exec python "$0" "$@"
fi
'''
# real Python script starts here

Would you prefer that?

Clemens

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to