Install Python3 on a Mac

Written by Art, June 18, 2017

Prerequisites for installing Python3 on Mac

Install Xcode

Xcode is Apple's Integrated Development Environment (IDE). You might already have Xcode on your Mac. If not, you can get Xcode from Apple appstore.

Xcode

Install Brew

Homebrew installs the stuff you need. Homebrew is a package manager for Mac OS

Step 1. Launch Terminal.

Go to Launchpad – Other – Terminal

Step 2. Install HomeBrew


/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Python3 with Brew

Enter brew command into terminal

brew install python3

Optional, PATH environment

Set up PATH environment variable, if you used HomeBrew to install Python3, then HomeBrew already added PATH.

Do not change PATH environment if you can launch python3 from terminal.

Add the following line to your ~/.profile file

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

Usually your Python installation directory looks like this, add it to your PATH

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"

Share with:

About author


Art

Art is a FinTech enthusiast who has a great passion for coding and teaching. He earned a M.Sc. from Adelphi University, Garden City, New York. Currently, he develops software for the financial services industry and leads classes and workshops in Python at PracticalProgramming.co

Web Development Front-End Immersive

Learn how to use HTML5 and CSS, JavaScript and React to Develop a modern single-page web application.

Learn more

Python Immersive

Become a proficient Python programmer, master programming skills by working on real life projects

Learn more

Python 101

This class aims to help beginners to feel justifiably confident to start using Python programming language

Learn more

Python for Data Science

Acquire Crucial Skills for the 21st century, Weekends , Master your analytical skills by working on real life projects

Learn more

Blockchain 101 NYC

Get introduced to Blockchain from the ground up and Build your own blockchain with Solidity

Learn more