How to configure SublimeREPL for Anaconda (Python)?

0

I installed the SublimeREPL for run the line or the selection directly from Sublime Text 2 . However, In the same way as in this previous problem , SublimeREPL is not using Anaconda but rather another version of Python. How to configure SublimeREPL to find the Anaconda path?

    
asked by anonymous 09.03.2014 / 17:49

1 answer

1

In the Packages/User folder, create the SublimeREPL/config/Python/ folders and the Main.sublime-menu folder with the following content (format json ), where in "cmd" line you will change the /path/to/Anaconda/python by the correct path to the% Anaconda on your computer. This will create two more options in SublimeREPL, one for the Anaconda Python and one for the Anaconda iPython.

[
    {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {
                    "caption": "Python",
                    "id": "Python",

                    "children":[
                        {
                            "command": "repl_open",
                            "caption": "Python - Anaconda",
                            "id": "repl_python",
                            "mnemonic": "p",
                            "args": {
                                "type": "subprocess",
                                "encoding": "utf8",
                                "cmd": ["/path/to/Anaconda/python", "-i", "-u"],
                                "cwd": "$file_path",
                                "syntax": "Packages/Python/Python.tmLanguage",
                                "external_id": "python",
                                "extend_env": {"PYTHONIOENCODING": "utf-8"}
                            }
                        },
                        {
                            "command": "repl_open",
                            "caption": "IPython - Anaconda",
                            "id": "repl_python_ipython",
                            "mnemonic": "p",
                            "args": {
                                "type": "subprocess",
                                "encoding": "utf8",
                                "autocomplete_server": true,
                                "cmd": ["/path/to/Anaconda/python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
                                "cwd": "$file_path",
                                "syntax": "Packages/Python/Python.tmLanguage",
                                "external_id": "python",
                                "extend_env": {
                                    "PYTHONIOENCODING": "utf-8",
                                    "SUBLIMEREPL_EDITOR": "$editor"
                                }
                            }
                        }
                    ]
                }
            ]
        }]
    }

Source: this SOEN response.

    
09.03.2014 / 19:58