When a python script is supposed to be run from a pyenv
virtualenv
what is the correct shebang for the file?
As an example test case, the d
If you need to use more shell than you can put in the #!
shebang line, you can start the file with a simple shell script which launches Python on the same file.
#!/bin/bash
"exec" "pyenv" "exec" "python" "$0" "$@"
# the rest of your Python script can be written below
Because of the quoting, Python doesn't execute the first line, and instead joins the strings together for the module docstring... which effectively ignores it.
You can see more here.