Python 3.6, install it from PPA or compile its source code on Ubuntu

Python 3.6 shell

Python is an open source programming language which it is ideal for all those who want to start programming, but this is just my opinion. Ubuntu 16.04 and Ubuntu 16.10 we can find two versions of Python; 2.7 and 3.5. At the time of writing this article, the last stable version of Python is 3.6.

In this short tutorial we are going to see two easy ways to install Python 3.6 on Ubuntu 16.10, Ubuntu 17.04.

To start, let's check which version of Python you use in your Ubuntu from the command line by typing:

python --version

Installing Python 3.6 on Ubuntu 16.10, Ubuntu 17.04 from the universal repository

Python 3.6 is included in the university repository for Ubuntu 16.10 and Ubuntu 17.04, so it can be easily installed with the following commands:

sudo apt update
sudo apt install python3.6

Once the installation is finished, we are going to check the version that we have just installed by typing the following in the terminal:

python3.6 -V

The previous command will show us a message like this on the screen:

Python 3.6.0

Download, compile and install Python 3.6 on Ubuntu

Now we are going to see how to install Python from scratch by downloading and complicating the package that we are going to download. First, some build dependencies will have to be installed using the following commands.

sudo apt install build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Once the installation is finished, we will download the source code from the official page  using wget.

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz

Once the download is finished, it is time to extract the contents of the package.

tar xvf Python-3.6.0.tar.xz

Once the extraction is finished, we are going to move to the directory where it was extracted using the cd command. Then we are going to configure the compilation environment and install.

cd Python-3.6.0/
./configure

If you get an error when executing the previous command, you can try the following:

./configure –enable-optimizations
sudo make altinstall

By using the altinstall command we will skip the creation of the symbolic link. This order may take a while, so be patient.

Once this is done, you can use the shell provided by the installation to write your codes by typing the following command in terminal:

python3.6

To exit the shell you just have to type:

quit()

Hope this tutorial helps you install Python on Ubuntu 16.10 and Ubuntu 17.04. Just say that if the shell that provides us with these facilities is a bit "austere", for many it is a bit short and uncomfortable. So you can always use Sublime Text 3 to develop your codes in this language or any other editor. Even with gedit you can write your codes without problems.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Carlos said

    I am trying to install microsoft 2013 on ubuntu 2016 and python does not show the setup.exe file. How is it solved? Thank you

    1.    Damian Amoedo said

      Hello. When you talk about Microsoft 2013, I imagine you are talking about Office. Assuming this, I tell you that to install it in Ubuntu you should try to install it using Wine. A colleague spoke about how to install it in Ubuntu a few months ago or if you prefer not to use wine, another colleague indicated how to install it in the next entry. I think you will get better results than using Python.
      Salu2.

  2.   Lucas matias gomez said

    Well, it came to me from 10.
    Thank you very much

  3.   etradu said

    How do I install PIP3 for python3.6?

    1.    Damien Amoedo said

      Test:
      curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6
      Salu2.

  4.   Vicente Chunga Tume said

    I had pytho3.6 installed and now python2.7 appears. I wanted to install but I get an error: dpkg execution was interrupted, you must manually execute "sudo dpkg –configure -a" to correct the problem. I did something wrong.

  5.   Victor said

    Hello, I'm new at this. I followed the steps but I don't know if it was installed or not, if someone explains more clearly how to do this type of installation. the readings in the terminal only say check and I end up in makefile