How to set which version of python sublime text uses

I teach python myself and started using python 2.7.5 and Sublime Text 2. I recently entered a class and they use python 3.4. I downloaded and installed python 3.4 on my Mac, but it's hard for me to figure out how to make Sublime Text use python 3 instead of 2.7. I used..

import sys print sys.version 

to determine which version of python ST used. He reports with 2.7.5.

How to get ST to use python 3?

If I have not included enough information, please feel free to ask.

+7
python sublimetext2 sublimetext macos
source share
1 answer

Found this one on Google.

Create the file ~/.config/sublime-text-2/Packages/Python/Python3.sublime-build :

 { "cmd": ["python3", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" } 

Then you can choose the Python3 build system.

If this does not work, try this :

 { "cmd": ["python3", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "encoding": "utf8", "path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/" } 
+9
source share

All Articles