How to Install Python3 on Mac OS X

Amir
Amir
How to Install Python3 on Mac OS X

In this post we’ll provide instructions on how to install Python3 on Mac OS X with brew.

Install Python3 on Mac OS X Using brew

Assuming you already have brew installed on your Mac, first run:

1
brew doctor

then:

1
brew install python3

If you encounter an error message related to link and Frameworks such as:

1
2
3
4
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

then you need to run the following commands to resolve the error:

1
2
3
sudo chown -R $(whoami) $(brew --prefix)/*
note the $(brew --prefix)/*
sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

This should then install Python3 and resolve any conflicts.

To test Python3 is installed correctly, run the following command:

1
python3 -V

Output, depending on your version of Python

1
Python 3.7.6

Install Python3 on Mac OS With Installer

Another way to install Python3 on Mac OS X is to use the installer.

  • Follow this link and download the latest python3 OS X package
  • Run the package and follow the steps to install python3 on your computer.
  • Once the installation is done, on your Terminal, run

which python3

which should print out the version of the python you just installed.

See also