Preface: If you are installing Python3 through brew, the latest version is python3.7.
Enter Python at this time, carriage return, such as the default python2.7 old version
Of course you can also input Python3, enter as new version of python3.7 for the latest installation
As an early patient of intermittent obsessive-compulsive disorder and perfectionism, or want the Python command to use the latest Python3 by default, the simplest settings are as follows:
- Command line execution: sudo vi/etc/paths
- New file first behavior:/usr/local/opt/python/libexec/bin
- : Wq Save and exit file
To complete the 3 steps above, reopen the New tab terminal, enter Python, return:
For example, not only Python,pip is also the latest version ~
Summarize:
Because of the newly installed Python3, including the PIP3, etc., the installation directory is /usr/local/opt/python/libexec/bin, so just add this directory to the environment variable global configuration file/etc/paths, over!
Mac default settings Python3 latest Version environment variable