All I want to do is. . .
. . .install Python 2 and/or 3.
Do these first:
Install the latest Mac C and C++ compilers
# Get the latest version of Xcode from the Mac App Store # Here: https://developer.apple.com/xcode/
# Open Xcode, then press `Command + ,` to open preferences
# Click `Downloads` at the top of the window # Then click `Install` next to `Command Line Tools`
Updated 2013-09-15: Add Xcode compilers as a dependency.
# On Mac >= 10.5 with homebrew $ brew update ## Install Python 2 $ brew install python ## Install Python 3 $ brew install python3 ## Follow any instructions that appear after each brew install
Make sure to follow the instructions after each install. If you missed them, just run
brew info python or
brew info python3.
If it still doesn't work, try to fix every issue listed when you run
# Is everything working? $ brew doctor # Listen to the doctor
If everything's working, you can run both Python 2 and Python 3 on the same system.
# Run Python 2 $ python # Run Python 3 $ python3 # Install a Python 2 package $ pip install some-package # Install a Python 3 package $ pip3 install some-package