Search code examples
pythonlinuxzshshebang

About python "#!usr/bin/env python"?


I put "#!usr/bin/env python" at the first line in coroutine.py, but when I try to run coroutine.py directly by "./test.py", I get this:

zsh: ./coroutine.py: bad interpreter: usr/bin/env: no such file or directory

Is that something wrong in my zshrc?


Solution

  • because you missed the leading slash: #!/usr/bin/env python and it's called hashbang (and not a shebang wich is only the #! part as @cdarke explained in comments)

    More about shebang/hashbang