Abhishek Goel
Abhishek Goel

Reputation: 19771

Sublime text 3 still using python 2.7. [ I have uninstalled it and installed python 3.3 ]

Since, we need python 3.3 to install package control in sublime text 3. So I have uninstalled python 2.7 which was there in my PC and installed python 3.3. I am not getting any error in python terminal for importing the libraries required to install sublime text package control but when I install it through sublime text (ctrl + `), I get the same errors which I was getting with python 2.7.

I want to know how do I make default python version for sublime text as 3.3 instead of 2.7.

PS : I have restarted my sublime text as well as my PC.

Upvotes: 1

Views: 4439

Answers (2)

Kos
Kos

Reputation: 72279

Sublime Text comes with its own Python version embedded inside. It is Python 2.7 for Sublime 2 and Python 3.3 for Sublime 3. This Python installation is used to run Sublime plug-ins; you also can access the console via the shortcut Ctrl+`.

On top of that, you can optionally install (any) Python version on your PC and use it yourself to run your Python programs. Sublime doesn't need it for anything, but if it's there, then it can help you to run the programs directly from editor with the "build system" feature.

Your Python installation doesn't have anything to do with the version that Sublime Text uses internally and doesn't have to match it.

Upvotes: 3

Bibhas Debnath
Bibhas Debnath

Reputation: 14939

:| You can very well use Python 2.7 to install Package control in ST3. I'm doing so. You might have messed up a lot more things than just ST3 by removing Python 2.7. For now, You can create a file called Python.sublime-build inside Packages/Python/ of your ST3 directory and write this -

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

Should work.

Upvotes: 0

Related Questions