How to install specific version of python on OS X
For Python in macOS, use pyenv:
brew install pyenv

To install a specific Python version, run:
pyenv install &lt;version&gt;

To select a version:
pyenv local 3.5.0

Note that you must update PATH to override the default Python version:
PATH=&quot;~/.pyenv/versions/3.5.0/bin:${PATH}&quot;

To list available versions:
pyenv versions

See https://gist.github.com/Bouke/11261620 for more information.