Search code examples
pythonpython-3.xvirtualenvshebangpython-packaging

correct shebang for virtualenv


I have Project shell_script and structure tree of virtualenv is shell_script/ENV/bin/python3 What should look like shebang to this dir tree?

This is not working

#!/ENV/bin/env python3.6

Solution

  • Assuming you have your virtualenv activated, you can use

    #!/usr/bin/env python3.x
    

    and that will find the proper executable you are interested in.