To install python3, first we must have brew installed on our system. To install brew on your system, run the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
By running the preceding command. brew will get installed. Now we will install python3 using brew:
brew install python3