[Ubuntu] Install and use Python 3.6 and switch to 2.7

Source: Internet
Author: User

Referenced from: 77502788

Currently using ubuntu14.04

1. Add the python3.6 installation package and install it (you can also go to the official website to download the installation package)

[HTML]View PlainCopy
    1. <code class="Language-python">sudo apt-get install Software-properties-common</ Code>

    1. sudo add-apt-repository ppa:jonathonf/python-3.6
    2. sudo apt-get update
    3. sudo apt-get install Python3. 6

2. Use which Python to view the directory where Python is installed by default

    1. Cd/usr/bin
    2. sudo rm python

3. Use which python3.6 to view the directory where the python3.6 is installed



4. Replace python2.7 with python3.6

sudo ln -s /usr/local/bin/python3.6 /usr/bin/python

In this case, enter Python in the terminal to see:

FINAL: switch to 2.7, in the same vein.

[Ubuntu] Install and use Python 3.6 and switch to 2.7

Related Article

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.