Mac installation python2.x and python3.x

Source: Internet
Author: User
Tags virtualenv

The MAC default installation version is 2.7.X, but the future trend will be python3, because MacOS relies on 2.7 of Python, so you can't change the default Python version. installing Python recommends using homebrew:

Brew Install Python3 installed with terminal operation:

Python//will run the default 2.7 version
Python3//will run the newly installed 3.x version to install the third party package:

PIP//will install the default 2.7 version of the package
PIP3//will install the 3.x version of the package pip after upgrade:

After the PIP upgrade, the version will change:
PIP//will install the 3.x version of the package
To install the version 2.7 package, you can use the following command:
Python-m PIP//will install the 2.7 version of the package recommended artifact: Virtualenv

Virtualenv can be on the Mac virtual a Python running environment, after use or after the wrong package to delete the folder directly can delete the virtual running environment, very convenient. And there's no need to change the native Python environment of the system.

Although Python3 reputation is not good, but the future trend will not change, Python2 will only be maintained until 2020, I suggest that we still learn python3 mainly, unless the need for the library does not support Python3, or try to avoid the use of python2. Python

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.