1- Download the latest version of python
Download the latest version of python
, such as version 3.6, the default installation location is: /Library/Frameworks/Python.framework/Versions/version number/
2- Open the terminal and modify the ~/.bash_profile file
export PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}
source ~/.bash_profile
check
$ python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.