Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Prerequisite for Python3 development
  1. Set Python3 as a default python version on your MacOS.
# Step 1: Install Python3 using homebrew
$ brew install python

# Step 2: Look for the path where the latest python3 is available
dineshsonachalam@macbook ~ % ls -l /usr/local/bin/python*
lrwxr-xr-x  1 dineshsonachalam  admin  24 May 30 11:31 /usr/local/bin/python -> /usr/local/bin/python3.9

# Step 3: Change the default symbolic link to version of python you want to use
$ ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python

# Step 4: Close the current terminal session or keep it that way and instead open a new terminal window (not tab). Check for the python version.
dineshsonachalam@macbook ~ % python --version
Python 3.9.2
  1. Set pip3 as a default pip version on MacOS.
# Step 1: Add alias to your ~/.zshrc
dineshsonachalam@macbook ~ % cat ~/.zshrc | grep -i "alias"
alias pip=pip3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment