Install Python on macOS X
To install Python on macOS X, do the following:
- Open the terminal by holding command and space (CMD + Space), typing terminal in the open search box, and hitting enter.
- Install Xcode through the command line by running xcode-select --install.
- The easiest way to install Python 3 is using homebrew, which is installed through the command line by running ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".
- Add homebrew to your PATH environment variable. Open your profile in the command line by running sudo nano ~/.profile and inserting export PATH="/usr/local/opt/python/libexec/bin:$PATH" at the bottom.
- The final step is to install Python. In the command line, run brew install python.
- Note that if you install Anaconda, the latest version of Python will be installed automatically.