DEV Community


Discussion on: How to set Python3 as a default python version on MacOS?

apoorveesinha profile image

Hey! I tried following your above-mentioned method .. but I don't know how the path is different ...Although this method worked but will that path create any problem later on?
On my mac
which pip results in
instead of

apoorveesinha@Apoorvees-Air ~ % python --version
Python 2.7.16
apoorveesinha@Apoorvees-Air ~ % python3 --version
Python 3.8.2
apoorveesinha@Apoorvees-Air ~ % pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
apoorveesinha@Apoorvees-Air ~ % pip3 install --upgrade pip
Collecting pip
Downloading (1.4MB)Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2
apoorveesinha@Apoorvees-Air ~ % which pip
apoorveesinha@Apoorvees-Air ~ % which pip
apoorveesinha@Apoorvees-Air ~ % sudo ln -s -f /usr/local/bin/python3.8 /usr/local/bin/python
apoorveesinha@Apoorvees-Air ~ %

close/open terminal

apoorveesinha@Apoorvees-Air ~ % python --version
Python 3.8.2
apoorveesinha@Apoorvees-Air ~ % python3 --version
Python 3.8.2

Please help!

garciatavo profile image

export PATH=/usr/local/opt/python3/libexec/bin:$PATH

Thread Thread
crimsonkida profile image

This worked for me! THANK YOU! :D

tedonmain profile image

I’m happy to read that the steps worked for you. The subject of the post I responded to was setting up Python 3 to be the default. From what I can tell, that is what you now have. My goal was to show how I did this directly versus using a package manager like Brew, but not everyone is comfortable with this approach. It looks like you are good to go if you want to work in Python 3 by default.