-1

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?

Koen
  • 311
  • 2
  • 11
  • 3
    You missed a slash. – Klaus D. Jun 28 '17 at 13:34
  • Generally, you shouldn't use this at all. The person installing or otherwise using your script is the only one who knows where the necessary version of Python is stored. `distutils` uses replaces `#!python` with the correct path upon installation for a reason. – chepner Jun 29 '17 at 20:37

1 Answers1

5

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

Arount
  • 9,853
  • 1
  • 30
  • 43
  • 2
    It's the `#!` that is called shebang because the `#` character is similar to the musical sharp character. It is often called "hash-bang" because `#` is known as "hash" outside the USA. – cdarke Jun 28 '17 at 13:47