MAC Upgrade python2.7 to 3.5

Source: Internet
Author: User


 

MAC system OSX 10.12 or more

1th Step: Download Python3.5

As follows:

Python3.5

Step Two: Install Python 3.50

Click on the downloaded pkg file for installation and after installation, the default installation path for Python 3.50 is as follows:


Step three: Modify the profile file

Add an alias directly to the. Profile. If your terminal is running a shell that is bash (the default), you can modify ~/.bash_profile and add:

Then restart the terminal or directly

# Setting PATH for Python 3.5

# The original version is saved in. bash_profile.pysave

Export path=$PATH:/library/frameworks/python.framework/versions/3.5/bin:

Alias python= "/library/frameworks/python.framework/versions/3.5/bin/python3. " 5"


Fourth step: Python 2.70 and Python 3.50 switch

Use Python 2.70: note aliaspython= "/library/frameworks/python.framework/versions/3.5/bin/python3. " 5"

Use Python 3.50: Open aliaspython= "/library/frameworks/python.framework/versions/3.5/bin/python3. " 5"

Fifth Step: Verify

Enter Python directly in the terminal to display the version number

MAC Upgrade python2.7 to 3.5

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.