Specify the absolute path to the Python version. For example, if Python version 3 is in /usr/bin/python3 , and Python 2 is in /usr/bin/python2 :
Python 3 build configuration:
{ "cmd": ["/usr/bin/python3", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "shell": true }
Python 2 build configuration:
{ "cmd": ["/usr/bin/python2", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "shell": true }
Find the Python location through which :
$ which python /usr/bin/python $ which python3 /usr/bin/python3 $ which python2 /usr/bin/python2
See Sublime Text 3 build system runs a different version of PHP , this is the same principle.
source share