{"id":24188,"date":"2017-11-09T07:07:22","date_gmt":"2017-11-09T13:07:22","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=24188"},"modified":"2022-12-12T09:17:53","modified_gmt":"2022-12-12T15:17:53","slug":"how-to-install-python-3-6-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-python-3-6-on-ubuntu-16-04\/","title":{"rendered":"How to Install Python 3.6 on Ubuntu 16.04"},"content":{"rendered":"
Today we will discuss how do you install Python 3.6 on Ubuntu 16.04. Python is a high-level, interpreted, interactive and object-oriented scripting language, and it is one of the most popular programming languages in the world. Python is designed to be highly readable and it can be used to build just about anything. It is using English keywords instead of punctuation and it also has fewer syntactical constructions than other programming languages.<\/p>\r\n\r\n\r\n\r\n
<\/p>\r\n\r\n\r\n\r\n
Python allows programmers to use different programming styles for creating their programs, get quicker results and write code almost as if speaking in a human language. Some of the most popular systems and applications in the world that have employed Python during development include Google Search, YouTube, Google App Engine, Maya, and many more. Installing\u00a0Python 3.6 on Ubuntu 16.04 is an easy task, just follow the steps in this tutorial carefully, and you should have Python 3.6 on Ubuntu 16.04 installed in few minutes. Let’s get started with the installation.
Python 2.7 and Python 3.5 are installed on Ubuntu 16.04 by default. In this tutorial, we will guide you through the steps of installing the latest Python 3.6 on Ubuntu 16.04.<\/p>\r\n\r\n\r\n\r\n
We have an update version of this tutorial on installing Python 3.9 on Ubuntu 20.04<\/a>.<\/p>\r\n\r\n\r\n\r\n First of all, login to your Ubuntu 16.04 VPS via SSH as user root<\/p>\r\n\r\n\r\n\r\n and update all installed packages<\/p>\r\n\r\n\r\n\r\n To check the currently installed version of Python, execute the following command<\/p>\r\n\r\n\r\n\r\n To check the Python 3 version, use the following command<\/p>\r\n\r\n\r\n\r\n There are two methods of installing Python 3.6 on an Ubuntu 16.04 VPS, from source, and from PPA.<\/p>\r\n\r\n\r\n\r\n In order to install the latest Python 3.6 release for Linux\/UNIX, go to their official website and download its source code to your server. At the moment of writing this article, it is version 3.6.3<\/p>\r\n\r\n\r\n\r\n and unpack the downloaded archive<\/p>\r\n\r\n\r\n\r\n Change the current working directory and run the ‘configure’ script<\/p>\r\n\r\n\r\n\r\n If there are no errors, run the following commands to complete the installation process of Python 3.6<\/p>\r\n\r\n\r\n\r\n If you get the following error message<\/p>\r\n\r\n\r\n\r\n install the ‘zlib1g-dev’ package<\/p>\r\n\r\n\r\n\r\n are run ‘make’ and ‘make install’ again.<\/p>\r\n\r\n\r\n\r\n That’s all. Python 3.6 should be successfully installed at this point. You can check this with the following command<\/p>\r\n\r\n\r\n\r\n You can also install Python 3.6 from J Fernyhough’s Personal Package Archive (PPA). Run the following command to add the PPA<\/p>\r\n\r\n\r\n\r\n and press enter to continue.<\/p>\r\n\r\n\r\n\r\n update the repositories<\/p>\r\n\r\n\r\n\r\n 7. Install Python version 3.6 on Ubuntu 16.04<\/p>\r\n\r\n\r\n\r\n and finally, install Python version 3.6<\/p>\r\n\r\n\r\n\r\n Once it is installed, you can verify the installed version by executing the following command<\/p>\r\n\r\n\r\n\r\n To learn more about Python version 3.6 check their official release notes<\/a>.<\/p>\r\n\r\n\r\n Of course, you don\u2019t have to Install Python 3.6 on Ubuntu 16.04, if you use one of our Python VPS hosting services<\/a>, in which case you can contact us and ask our expert Linux admins to Install<\/span> Python 3.6 on Ubuntu 16.04 for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\r\n\r\n\r\n\r\n PS<\/strong><\/span>. If you liked this post on how to install Python 3.6 on Ubuntu 16.04, please share it with your friends on social networks or simply leave a reply below. Thanks.<\/p>\r\n\r\n\r\n\r\n There is a new updated article on how to install Python 3.9 on Ubuntu 20.04<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":" Today we will discuss how do you install Python 3.6 on Ubuntu 16.04. Python is a high-level, interpreted, interactive and … <\/p>\n1. Login via SSH and update all installed packages<\/h3>\r\n\r\n\r\n\r\n
ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\n
2.\u00a0Check the currently installed version of Python<\/h3>\r\n\r\n\r\n\r\n
# python -V\r\nPython 2.7.12<\/span><\/pre>\r\n\r\n\r\n\r\n
# python3 -V\r\nPython 3.5.2<\/span><\/pre>\r\n\r\n\r\n\r\n
3. Install Python 3.6 on Ubuntu 16.04, from source<\/h3>\r\n\r\n\r\n\r\n
cd \/opt\r\nwget https:\/\/www.python.org\/ftp\/python\/3.6.3\/Python-3.6.3.tgz<\/pre>\r\n\r\n\r\n\r\n
tar -xvf Python-3.6.3.tgz<\/pre>\r\n\r\n\r\n\r\n
4. Method 1: Run the “configure” script<\/h3>\r\n\r\n\r\n\r\n
cd Python-3.6.3\r\n.\/configure<\/pre>\r\n\r\n\r\n\r\n
make \r\nmake install<\/pre>\r\n\r\n\r\n\r\n
zipimport.ZipImportError: can't decompress data; zlib not available<\/pre>\r\n\r\n\r\n\r\n
apt-get install zlib1g-dev<\/pre>\r\n\r\n\r\n\r\n
# python3.6 -V\r\nPython 3.6.3<\/span><\/pre>\r\n\r\n\r\n\r\n
5. Method 2: Install Python 3.6 from PPA<\/h3>\r\n\r\n\r\n\r\n
Install the following requirements<\/p>\r\n\r\n\r\n\r\napt-get install software-properties-common python-software-properties<\/pre>\r\n\r\n\r\n\r\n
# add-apt-repository ppa:jonathonf\/python-3.6\r\nPress [ENTER] to continue or ctrl-c to cancel adding it<\/pre>\r\n\r\n\r\n\r\n
6. Update the repositories<\/h3>\r\n\r\n\r\n\r\n
apt-get update<\/pre>\r\n\r\n\r\n\r\n
apt-get install python3.6<\/pre>\r\n\r\n\r\n\r\n
7. Verify Python 3.6.3 installation<\/h3>\r\n\r\n\r\n\r\n
# python3.6 -V\r\nPython 3.6.3<\/span><\/pre>\r\n\r\n\r\n\r\n
\r\n\r\n\r\nSee also<\/span> – How to Install Python 3.6.4 on CentOS 7<\/a><\/span><\/h4>\r\n\r\n\r\n\r\n
<\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n