pythonmacossublimetextread-eval-print-loopsublimerepl

How to run Python 3 in Sublime 2 REPL Mac


My question is the following, I have sublime 2 and sublime repl plugin installed all working fine, the only thing i need is to change the version of python that is running on the sublimerepl built in console. What I mean is, I have python 2.7.5 (which is pre installed with maveriks) running fine in sublime (via sublimerepl), and I have installed via the installer from python.org, python 3.3.3 , that I need to use, I want to run this version of python on the sublimerepl console but I don't know how.

I know that there are alternatives to sublime but none of those are so beautiful as sublime is.

Can someone help me with this ? I've searched for all over the internet and couldn't find anything helpful.

Btw if I use terminal python 3.3.3 is working fine (Terminal>'python3'), I know this is possible beacause a friend of mine got it working and I have installed mine like he did, but mine is not working.


Solution

  • @poke's answer is good, but there are a few details to correct that I figured I'd just put in my own answer as they're too long for comments. First, the .sublime-menu entry should be named Packages/User/SublimeREPL/config/Python/Main.sublime-menu (naming the file something else won't integrate it into the menu system, it has to be Main.sublime-menu AFAIK). Also, for your system, you should probably change the "cmd" lines to point to /Library/Frameworks/Python.framework/Versions/3.3/bin/python3, which is where the python.org installation is located. So, for example, where it says

    "cmd": ["python", "-i", "-u"],
    

    change that to

    "cmd": ["/Library/Frameworks/Python.framework/Versions/3.3/bin/python3", "-i", "-u"],
    

    Good luck!