Installing Py3 and switching Py2 and Py3 environments in Ubuntu14.04

Source: Internet
Author: User

A few days ago to share with you how to install the Ubuntu14.04 system, interested in small partners can poke this article: hands-on to teach you to install the Ubuntu14.04 system in VMware virtual machines. Today, I would like to share with you a simple tutorial on how to install Python3 in the Ubuntu14.04 system, and implement the Python2 and Python3 Direct switch, the following tutorial.

1, in the Ubuntu system, about Python2 and Python3 installation is actually very simple, more simple than the installation under Windows. Generally speaking, Python2 is the Ubuntu system comes with, the default version is Python2.7, the normal situation is no need to install. Enter Python2 directly on the command line to enter the Python2 environment, as shown in.



2, here to Python3 installation as an example, enter the installation command directly on the Ubuntu14.04 system command line: sudo apt-get install python3.4. Be sure to specify the version of Python, if you want to install Python3.5, Python3.6, the installation command for sudo apt-get install python3.5, sudo apt-get install python3.6 can be. The installation process is generally quick, as shown in.



This is because the Python3.4 has been installed before the small series, so there is no specific installation process. If you do not have Python3.4 installed on your system before, there will be a big push to install the process prompt.

3, note that the Ubuntu version is low, you can only install the lower version of the Python3. Is the process of installing Python3.2 in Ubuntu12.04.



However, Ubuntu12.04 does not support installing Python3.4 and cannot find the corresponding installation package, as shown in.



4, similarly, in the Ubuntu14.04, it does not support python3.5 and python3.6, so at the time of installation can not find the installation package, as shown in.



If you really want to install more than Python3.5, you'll need to upgrade the Ubuntu14.04 or install the Ubuntu version 16.04 or higher directly.

5. After the installation completes the Python3.4 version, enter python3 on the command line to switch to the Python3.4 version, as shown in.



6. By default, we enter Python,ubuntu on the command line to switch to Python2.7 's environment by default, as shown in.



7, if you want to switch to the PYTHON3 environment, only need to enter the Python3 or corresponding version number such as python3.4 can, as shown.



The installation of Python in Ubuntu is more than just this method, but this method is the simplest and most convenient, and more installation methods are not described here. Finally, we recommend that you do not have the Ubuntu system in the Python2 version removed, because there are many other applications also need to Python2 support, accidentally deleted, the latter may encounter unexpected problems.


Installing Py3 and switching Py2 and Py3 environments in Ubuntu14.04

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.