what shebang to use for python scripts run under a pyenv virtualenv

前端 未结 5 1756
攒了一身酷
攒了一身酷 2020-12-08 18:34

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

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 18:48

    I don't really know why calling the interpreter with the full path wouldn't work for you, I use it all the time, but if you want to use the python interpreter that is in your environment you should do:

    #!/usr/bin/env python
    

    That way you search your environment for the python interpreter to use.

提交回复
热议问题