Python is the fastest growing major general-purpose programming language. There are many reasons for this, such as its readability and flexibility, ease of learning and use, reliability and efficiency.
There are two major Python versions in use - 2 and 3 (Python Now and Future); the former will not see new major versions, while the latter is under active development and has seen over the past few years Many stable releases have been released. The latest stable version of Python 3 is version 3.6.
Ubuntu 18.04 and Ubuntu 17.10 both come with Python 3.6 pre-installed, which is different from older versions of Ubuntu. In this article, we will explain how to install the latest Python 3.6 in Ubuntu 14.04, 16.04, 16.10 and 17.04 via APT package manager.
Installing Python 3.6 in Ubuntu 14.04 and 16.04
Ubuntu 14.04 and 16.04 come with Python 2.7 and Python 3.5 by default. To install the latest Python 3.6 version, you can use the "deadsnakes" team PPA, which contains the latest Python version packaged for Ubuntu.
$ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt update $ sudo apt install python3.6
Installing Python 3.6 in Ubuntu 16.10 and 17.04
In Ubuntu 16.10 and 17.04, you can find the Python 3.6 package in the Universe repository and via apt Install it easily as shown below.
$ sudo apt update $ sudo apt install python3.6
To see a list of all Python binaries installed on your system, run the following ls command.
$ ls -l /usr/bin/python*
Python Binary List
From the output of the above screenshot, the default Python version on the test system is 2.7, you can also use the below Command to check Python version.
$ python -V
To use Python 3.6, call the following command.
$ python3.6
Python Interpreter
To exit the Python interpreter, enter the following command and press Enter.
quit() OR exit()
Related recommendations: "Python Tutorial"
In this article we introduce to you how to use the APT package manager in Ubuntu 14.04, 16.04, 16.10 and 17.04 Install Python 3.6, I hope it will be helpful to friends who need it!
The above is the detailed content of How to install Python 3.6 in Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!