Related: Is there a standard way to make sure that a python script will be interpreted by python2, not python3?
Apparently, not all distributions come with a symlink python3. #!/usr/bin/env python3raises a no-such-file-or-directory error. Which shebang line should I use if my script requires any version of Python 3?
python3
#!/usr/bin/env python3
import sys try: assert sys.version_info[0] == 3 except: print "ERROR NOT PYTHON 3!" sys.exit()