Mac default settings Python3 latest Version environment variable

Source: Internet
Author: User

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:

    1. Command line execution: sudo vi/etc/paths
    2. New file first behavior:/usr/local/opt/python/libexec/bin
    3. : 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.