How to Set-Up a Python Environment on Mac

For this tutorial, I’ll walk you through the process I completed on my MacBook with VSCode. There are dozens of other Python environments (IDE’s) that you can use, and of course, you can use your Windows machine (as much as my inner Apple fan-boy doesn’t want you to).

Be sure to read the pages linked and follow the instructions carefully as not every code sample can be copied and pasted directly into your terminal to get everything installed.

VSCode installation

PATH set-up

Once you’ve installed VSCode and set-up your PATH, open a new terminal window in VSCode

Next you’ll want to Install Homebrew.

Homebrew is a package manager for macOS that simplifies the process of installing, updating, and managing software on your Mac in the terminal.

/bin/bash -c "$(curl -fsSL"

Once that finishes, don’t neglect the two steps displayed in the terminal. You’ll need to run two commands which can be copied and pasted, and then run by hitting “return”

Everything that is displayed on the first line that looks like the code below (you’ll see your home directory after the “>>” make sure that you copy that too.)

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> <your home directory> 

Everything on the second line

eval "$(/opt/homebrew/bin/brew shellenv)"

Once you have that set-up, head over to this VS Code guide to Install Python into your IDE.

I do like to complete the “Hello World” Tutorial on a fresh build, but you by no means need to do so.

Upgrade pip

python3 -m pip install --upgrade pip

Be sure to check your version of Python when running this command. (It works as of 12.28.23)

You should be all set and ready to begin working with Python in VSCode on your Mac.

Leave a Reply

Your email address will not be published. Required fields are marked *