PAGE: Auto created shebang [SOLVED]

Starting to use PAGE and I’ve got a basic form coded in no time flat, but I’m having to replace the shebang line that is generated by PAGE so that the ‘app’ will run.

The generated shebang: #! /usr/bin/env python
My replacement: #!/usr/bin/python3 which I’ve been using for as long as I can remember.

So, the question is: is there something wrong with my Python setup that is causing PAGE to generate an incorrect (if it is indeed incorrect) shebang line?

I’ve had a look on PAGE PAGE - Discussion , but I can see no mention of this being an issue for anyone else; hence my question here.

Platform: Linux
Python: Python 3.6.9

With thanks.


Fixed: I was running PAGE 7.4 and having updated that to 7.6, the issue no longer exists:

The generated shebang is now: #! /usr/bin/env python3

I always use the #!/usr/bin/python3 version and avoid/replace any use of /usr/bin/env.
Indeed i often use #!/usr/bin/python3.6 if that is the version that I used to QA a script.

I do not want random python3 on my path to be used for my scripts.

I do know that people on systems where python is not in a well define place like using env so that they just have to set PATH and the scripts work.

Thanks for the reply and the info. Given that, my guess is that the PAGE project guys have used /env/ for that precise reason.

I’ve posted about my findings in Discussion forum

Is the /usr/bin/env thing portable to Mac, btw?

… Actually, why/how is it different from just using #!python? if the job of env is “Set each NAME to VALUE in the environment and run COMMAND.” and there’s nothing specified to set…

Yes /usr/bin/env works on macOS.

You cannot use #!python3 on linux as it is the kernel that processes the #! and it does not take the PATH into account.

1 Like