How to Install IDLE Python IDE on Ubuntu

IDLE stands for Integrated DeveLopment Environment. It is an IDE for Python, written in Python language itself and based on Tkinter with bindings to the Tk widget set. IDLE is most suitable for beginners as it is easy to use and not feature-overloaded. Hence, it is very popular in educational environments.

IDLE is a cross-platform IDE solution that comes with a basic feature set that includes:

  • Multi-window text editor with syntax highlighting, auto-completion, smart indent, and other features to make coding easy.
  • Python shell with syntax highlighting.
  • Integrated debugger with stepping, persistent breakpoints, and call stack visibility.

For more information on IDLE, visit the following official documentation:

https://docs.python.org/3/library/idle.html

In this article, we will install IDLE Python IDE through the Ubuntu command line. The article also explains how to launch IDLE and use it to write and run a simple Python script.

We have run the commands and procedures mentioned in this article on a Ubuntu 20.04 or 22.04 system.

How to Install IDLE?

Python is installed by default on all the latest Ubuntu releases and usually comes with the IDLE application. However, if you have a minimal installation of Ubuntu that lacks any IDLE UI application, you can install it by following this method:

Open the Ubuntu command line, the Terminal, through the system Dash or the Ctrl+Alt+T shortcut.

Then, you need to update your system’s repository index through the following command as sudo:

$ sudo apt-get update

This way, your system’s repository gets in line with the Internet repositories, and helps you install the latest version of any available software.

Update the package list

You must run this command as sudo because only an authorized user can add/remove, update, and configure software on Ubuntu. The system will ask you for the password for sudo and then execute the rest of the command when you have provided a correct password.

The next step is to run the following command to install IDLE3. This is the best-suited version when you install either Python 2 or Python 3 on your system.

$ sudo apt-get install idle3

Install IDLE

The system might ask you for a Y/n input to make sure that you indeed want to install the software. Please enter Y and then hit Enter, after which IDLE3 will be installed on your system.

Launch IDLE

You can launch IDLE both through the command line or the Ubuntu UI.

Run the following command in the Terminal in order to launch IDLE.

$ idle

Launch IDLE

Or else, enter keywords relevant to IDLE in your Ubuntu Dash search as follows:

IDLE Desktop Icon

This will list all the IDLE applications installed on your system. Click on any one of them to Launch the Python integrated development environment.

Your first Python program in IDLE

Open the IDLE application, which by default looks like this:

Python Shell

Your first line of code starts from where you see the three “greater than” or “>” symbols.

Place the cursor at this point and write or copy & paste the following line of code:

print("This is my first Python program :) :)")

This simple print statement can be used to print anything inside the parentheses “( )”, on the screen.

When you hit Enter, the output is displayed as follows:

My first Python Program

You can even save the program (through the Save/Save As option from the File menu) and access it later (through the Open option from the File menu or directly by clicking it from where you have saved it).

After reading this article, you can integrate the IDLE Python development environment into your Ubuntu system and make the best use of its UI-based simple and easy-to-use feature set.