From 4f1a3ee8dca1eb3e8ccfb116a5ffef6a654b8fd6 Mon Sep 17 00:00:00 2001 From: lboogaard Date: Mon, 5 Mar 2018 13:31:13 +0100 Subject: [PATCH] Update Homebrew-and-Python to describe install I believe the Homebrew-and-Python page could use a description on how to exactly install Python 2.X and 3.X with Homebrew. The syntax is written to my best knowledge (but likely wrong), please update this so that it is correct. Finding out the correct syntax is what actually motivated me to update this page in the first place. I'm hoping that this will clarify to the community (or at least me) on how to exactly install Python 2.X and 3.X with Homebrew. Keep up the amazing work! --- docs/Homebrew-and-Python.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md index 6d24b214f4..a50e2da52e 100644 --- a/docs/Homebrew-and-Python.md +++ b/docs/Homebrew-and-Python.md @@ -9,7 +9,26 @@ Homebrew provides formulae to brew 3.x and a more up-to-date Python 2.7.x. **Important:** If you choose to install a Python which isn't either of these two (system Python or brewed Python), the Homebrew team cannot support any breakage that may occur. ## Python 3.x or Python 2.x -Homebrew provides one formula for Python 2.7.x and another for Python 3.x. The executables are organized as follows so that Python 2 and Python 3 can both be installed without conflict: +Homebrew provides one formula for Python 2.7.x and another for Python 3.x. + +To install Python 3.X with Homebrew: + +`brew install python` +or +`brew install python3` + +To (optionally) install Python 2.X with Homebrew: + +`brew install python2` +or +`brew install python@2` + +For Python 2.X only: if you want to be able to call `python2` from the path, add the following line to your `~/.bash_profile` (or equivalent). For more information, see the formula's caveats. + +`export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"` + + +The executables are organized as follows so that Python 2 and Python 3 can both be installed without conflict: * `python` and `python3` point to Homebrew's Python 3.x (if installed) otherwise the macOS system Python * `python2` points to Homebrew's Python 2.7.x (if installed) * `pip` and `pip3` point to Homebrew's Python 3.x's pip (if installed)