Skip to content

Instantly share code, notes, and snippets.

@rafaelgotts
Created April 13, 2017 15:29
Show Gist options
  • Select an option

  • Save rafaelgotts/da954cba10878af73dd6549a47d3a8c8 to your computer and use it in GitHub Desktop.

Select an option

Save rafaelgotts/da954cba10878af73dd6549a47d3a8c8 to your computer and use it in GitHub Desktop.
Install another python version from homebrew

How to install another python version on homebrew

edit your existing homebrew formula eg.: $rafael: brew edit python3

Change the url version to your desired version, eg: url "https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz" to url "https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tar.xz"

save with another name, eg: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python341.rb

** My homebrew directory is : /usr/local/Homebrew/ you can check yours with echo $(brew --repo)

then, install your formula, eg: brew install --debug python341.rb

** --debug is for shows more info in case of errors (and will be)

I have some problems with checksum, then i download the file from url and use shasum to update the formular

shasum -256 $HOME/Downloads/Python-3.6.1.tar.xz

After this i create a symbolic link to the installed binary, eg:

brew switch or ln -s /usr/local/Cellar/python341/3.4.1/bin/python3 /usr/local/bin/python3.4 or ln -s /usr/local/Cellar/python341/3.4.1/Frameworks/Python.framework/Versions/3.4/bin/python3 /usr/local/bin/python3.4

ref.: http://stackoverflow.com/questions/24767286/how-to-install-python-3-3-not-3-4-on-os-x-with-homebrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment