Skip to content

Instantly share code, notes, and snippets.

@zoidyzoidzoid
Forked from Bouke/gist:11261620
Last active August 29, 2015 14:20
Show Gist options
  • Save zoidyzoidzoid/236ced43a5e5c08a18f5 to your computer and use it in GitHub Desktop.
Save zoidyzoidzoid/236ced43a5e5c08a18f5 to your computer and use it in GitHub Desktop.

The brew versions command has been removed. The instructions are no longer valid.

Prerequisits

Make sure you don't have any Python 3.x installed:

$ brew uninstall python3

Then cd into your brew directory, this is /usr/local normally:

$ cd /usr/local

Then list all the available Python 3.x versions in Homebrew:

$ brew versions python3

Python 3.0

Sorry, not available with Homebrew.

Python 3.1

$ git checkout 0476235 Library/Formula/python3.rb
$ brew install python3
$ brew unlink python3
$ ln -s ../Cellar/python3/3.1.3/bin/python3.1 bin/python3.1

Python 3.2

$ git checkout f33f3ea Library/Formula/python3.rb

This formula requires X11, but if you don't have/want it, do not dispair. In Library/Formula/python3.rb on line 44, remove this line:

  depends_on :x11 # tk.h includes X11/Xlib.h and X11/X.h

Also, sqlite didn't work on my machine, so replace this line:

  depends_on 'sqlite'   => :optional  # Prefer over OS X's older version

By this:

  depends_on 'sqlite' => :build

Then install as usual:

$ brew install python3
$ brew unlink python3
$ ln -s ../Cellar/python3/3.2.3/bin/python3.2 bin/python3.2

Python 3.3

$ git checkout fedb343 Library/Formula/python3.rb
$ brew install python3
$ brew unlink python3
$ ln -s ../Cellar/python3/3.3.5/bin/python3.3 bin/python3.3

Python 3.4

$ git checkout HEAD Library/Formula/python3.rb
$ brew install python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment