Python is one of the easiest and craziest programming language which is very fun to use. Many developers are started to learning python once they are over with PHP.
Some people make it as their first choice as it is recommended by the Many people. When you do development, it should be made on open source platform.
Ubuntu and Python both makes it awesome for you. Now, grab a Ubuntu 16.04 server if you dont have one.
In this tutorial, we will see how to install Python 3.6 on Ubuntu 16.04.
If you are using any other version of ubuntu, i strongly suggest you to take ubuntu 16.04.
- Have a Ubuntu 16.04 server with a sudo user created according to this server setup guide.
Considering that you have new server with no previous installation of Python, i am writing this guide.
Install Python 3.6 on Ubuntu
First connect to your cloud/VPS server with your local terminal(Linux) or Putty(for windows)
Now, we have to download the Python package on the server using wget utility. You can do this with curl.
We will download the archive in another location on server. Change location to /opt.
$ cd /opt
After that, use wget to download the python package.
$ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
To unpack the archive use tar utility.
$ tar -xvf Python-3.6.3.tgz
Now move to unpacked python package folder.
$ cd Python-3.6.3
Now run configure command.
You should not see any error and must have zlib installed.
If you have not installed zlib, then you will get error while running the below commands.
So, if you get zlib not available command, just use the below command to install zlib.
$ apt-get install zlib1g-dev
Now, execute the below command.
$ make $ make install
Now, python has successfully installed on your machine.
There is an alternate method for installing python. Let see that one here.
You can install python from Personal Package archive.
$ apt-get install software-properties-common python-software-properties
Use the below command to add the PPA to ubuntu repository.
$ add-apt-repository ppa:jonathonf/python-3.6
Now, press enter to continue to proceed.
Then, update the package index using the below command.
$ apt-get update
After that, you can directly install Python using the simple command.
$ apt-get install python3.6
That’s all. Now python is installed on your machine and you can check that by executing the below command.
$ python3.6 -V
Installing Python is an easier task. If you have any questions or getting error while executing, just comment here to help.
Subscribe to our news letter to get notified for the next tutorial.