Last active
August 29, 2015 14:14
-
-
Save jacebrowning/0b180242d45dbda0846d to your computer and use it in GitHub Desktop.
Bootstraps a Python 3 installation on a new Mac.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
# ====================================================================== | |
# 1. Click the spotlight icon | |
# 2. Type "terminal" and press enter | |
# 3. In the new window, type "gcc" and press enter | |
# 4. If another dialog appears, click Install and wait for completion | |
# 5. Click the spotlight icon | |
# 6. Type "terminal" and press enter | |
# 7. Copy all of the lines below this block | |
# 8. Switch to Terminal.app and paste the clipboard | |
# ====================================================================== | |
which -a python3 && which -a pip3 | |
if [ $? -ne 0 ]; then | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
brew install python3 | |
fi | |
python3 -c ' | |
import pip | |
import platform | |
python_version = platform.python_version() | |
pip_version = pip.__version__ | |
assert python_version.startswith("3.") | |
print() | |
print("python %s" % python_version) | |
print("pip %s" % pip_version) | |
print() | |
' | |
which -a python3 && which -a pip3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If this works, you should be able to run something like: