What shebang for Anaconda Python on my directory of Server

The rest of the first line after the shebang is parsed as an interpreter directive.

If you want your script to be interpreted / run by an specific binary you need to point to that binary after the shebang.

In this case you need to write something like this:

#!/home/yourusername/anaconda/bin/python


To add to the already accepted answer (and reply to 0xc0de's comment), I think we can use:

#!/usr/bin/env python

Then we need to activate the Conda environment, or source the custom Python path that we want to use.

By doing so, #!/usr/bin/env will find the right Python version, and also will make sure that the script will run correctly inside the virtual environment.