Reputation: 331
Hi I cannot seem to understand why even though I just installed Python 3.9.5 (from here https://www.python.org/downloads/), the python3 command runs python 3.8.2 on the terminal, shown below.
This is my first time installing python on my Mac (macOS Big Sur).
MacBook-Air ~ % python --version
Python 2.7.16
MacBook-Air ~ % python3 --version
Python 3.8.2
How can I run what I actually installed, which is python3.9.5?
I appreciate your help.
Upvotes: 1
Views: 8889
Reputation: 39810
You should remove the current link and add a new symbolic link
unlink /usr/local/bin/python
ln -s /usr/local/bin/python3.9 /usr/local/bin/python
If you also want to be able to run Python 3.9.5 by calling python3
you can do so either as above or by updating your bash profile.
Inside ~/.bash_profile
simply add the following line:
alias python3='/usr/local/bin/python3.9'
and finally reload it
source ~/.bash_profile
You should now get
python3 --version
Python 3.9.5
Upvotes: 2