#!/usr/bin/python and #!/usr/bin/env python, which support?

前端 未结 4 1071
无人共我
无人共我 2021-02-08 11:35

How should the shebang for a Python script look like?

Some people support #!/usr/bin/env python because it can find the Python interpreter intelligently. Ot

4条回答
  •  感情败类
    2021-02-08 12:12

    My humble opinion is that you should use the env-variant. It's a POSIX component thus found in pretty much every system, while directly specifying /usr/bin/python breaks in many occasions, i.e. virtualenv setups.

提交回复
热议问题