How to install Python3 on macOS using Homebrew

Let’s see today how to easily use Phython 3 in your macOS using Homebrew.

Before starting let’s remember what’s Homebrew.

“Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system. Originally written by Max Howell, the package manager has gained popularity in the Ruby on Rails community and earned praise for its extensibility.[1] Homebrew has been recommended for its ease of use[2] as well as its integration into the command line.[3]”

But particularly what I most like in Homebrew is the fact that by default it installs everything under /usr/local (can be changed) to avoid conflicts with system directories.

Installing Homebrew

To install it all you need is just a simple command in your terminal

Once it finishes just try it to see if it worked properly

If it returns something different than command not found, it worked.

Now just try doctor

If you see something like “Your system is ready to brew.” you’re ready.

Python 3

Time to install Python 3 using Homebrew

Wait until the end of the installation and check if Python3 is there, executing python3 in your terminal, you must see something like that

Tip : Do not forget that the same pattern “3 in the end” applies for pip too, instead of executing pip you’ll use pip3.

Now is more of the same, write your code and use python3, if you’re using an IDE to it, do not forget to change your interpreter, if you’re using the default Homebrew configuration you’ll find it somewhere under /usr/local/Cellar, in my case.

All right, just go for it. Happy coding 🙂

Leave a Reply