I just installed Python 3.5 on my Mac OS Sierra and update my .bash_profile file:
MacBook:~ admin$ more .bash_profile
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
When I check if the PATH is correctly set, I have the below output:
MacBook:~ admin$ echo "$PATH"
/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet
However, when I run Python from a terminal, Python 2.7 is still executed:
MacBook:~ admin$ python --version Python 2.7.12
MacBook:~ admin$ which python /usr/local/bin/python
How can I use Python 3.5 by default?
python3