How to manage python shebang on mixed systems?

Barry Scott barry at barrys-emacs.org
Mon Nov 7 15:48:48 EST 2022



> On 7 Nov 2022, at 09:28, Chris Green <cl at isbd.net> wrote:
> 
> Chris Green <cl at isbd.net> wrote:
>>> 3: with your pseudo "python3" script in place, make all the scripts use 
>>> the "#!/usr/bin/env python3" shebang suggested above.
>>> 
>> Yes, that sounds a good plan to me, thanks Cameron.
>> 
> Doesn't '#!/usr/bin/env python3' suffer from the same problem as
> '#!/usr/bin/python3' in the sense that the env executable might not be
> in /usr/bin?

env is always available as /usr/bin/env - I think its spec'ed in posix that way.

The only reason that things are in /bin are for systems that need a subset of
programs to boot the system to point it can mount /usr. env is not going to be
needed for that use case.

> 
> Wouldn't '#! env python3' be better?

Barry

> 
> -- 
> Chris Green
> ·
> -- 
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list