This is some basic instructions on how I setup my Python/Scipy/NumPy/Pandas/etc stack. This is really just for me and probably won't help anyone else. The only thing I am missing is a description of how to install pip.
-
Download and install Continuum Analytics's Anaconda
-
In the terminal, run:
conda create -n py3k python=3 anaconda source activate py3k
source activate py3k
-
Open the terminal
-
Run:
export PATH=/Users/chrisralbon/anaconda/envs/py3k/bin:$PATH ipython notebook
export PATH=/Users/chrisralbon/anaconda/envs/py3k/bin:$PATH pip install pandas
conda install -n py3k pip
Note that py3k is the name of the acaconda environment we installed in the top of this document
-
Go to tools/build system/build new system, call it "Python3"
-
Paste in this (if you have Anaconda installed)
{ "cmd": ["/Users/chrisralbon/anaconda/envs/py3k/bin/python3", "-u", "$file"], "file_regex": "^[ ]File "(...?)", line ([0-9]*)", "selector": "source.python", "env": {"LANG": "en_US.UTF-8"} }
-
Go to tools/build system/build new system, call it "Python2"
-
Paste in this (if you have Anaconda installed)
{ "cmd": ["/Users/chrisralbon/anaconda/bin/python", "-u", "$file"], "file_regex": "^[ ]File "(...?)", line ([0-9]*)", "selector": "source.python", "env": {"LANG": "en_US.UTF-8"} }
In this case, this module: https://github.com/wrobstory/climatic.git
export PATH=/Users/chrisralbon/anaconda/envs/py3k/bin:$PATH pip install -e git+https://github.com/wrobstory/climatic.git#egg=climatic
conda update pip -p /Users/chrisralbon/anaconda/envs/py3k
In your Packages/User folder, create SublimeREPL/config/Python/Main.sublime-menu with the following contents:
[
{
"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": ["/Users/chrisralbon/anaconda/envs/py3k/bin/python3", "-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": ["/Users/chrisralbon/anaconda/envs/py3k/bin/python3", "-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"
}
}
}
]
}
]
}]
}
]
Save the file, and you should now have Tools -> SublimeREPL -> Python -> Python - Anaconda and IPython - Anaconda menu options to start REPLs with the Anaconda interpreter.
source activate py3k
BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ipython notebook