In this case, it's not the #!
-line you should be changing, but your $PATH
.
#!/usr/bin/env python3
This has the effect that the python3
interpreter will be searched for in the directories listed in your $PATH
variable.
If python3
is installed in, e.g., $HOME/local/bin
, then this directory must be present in $PATH
before any other directory that may also contain a python3
interpreter, otherwise that one will be used instead of your own in $HOME/local/bin
.
So you need to set
PATH="$HOME/local/bin:$PATH"
Either on the command line, or in a shell initialization script (~/.bashrc
for example). C-shell users do it differently...
set path = ($HOME/local/bin $path)
In general, the #!
-line identifies the interpreter for the script, i.e. what program to use to parse and run the file. A sed
script, for example, may use #!/usr/bin/sed -f
.