Wanted to try out some Python NLP packages, found API discovery in Jupyter less than ideal.
Sublime Text 3 gave me a headache because it didn't pick up the default Python version I set using pyenv.
- Ensure
pyenv
works and is set up to use your default Python version of choice. - Identify PATH elements inserted by Pyenv:
user@host ~> echo $PATH /usr/local/opt/pyenv/shims:/usr/local/opt/pyenv/bin:/usr/local/opt/rbenv/shims:/usr/local/opt/rbenv/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin user@host ~>
- Add these elements to Sublime Text's user preferences:
{ "additional_path_items": [ "/usr/local/opt/pyenv/shims", "/usr/local/opt/pyenv/bin", "~/.rbenv/shims", "~/.rbenv/bin", "~/.bin", "/usr/local/bin" ], ... }
- Test correct version with some Python code in Sublime Text 3:
Sublime Worksheet is handy for cases like this where you'd like to write and test out some code quickly without the burden of thinking about where to save the file, what to name the file etc.
import os os.system("python --version") # > Python 3.5.1 # > 0