How to Install IDLE Python on Ubuntu Linux

IDLE is Python’s official integrated development environment, bundled with Python itself and available directly from Ubuntu’s default repositories. If you need a lightweight environment for learning Python, testing code snippets, or debugging scripts, IDLE provides an interactive shell with syntax highlighting, auto-completion, and an integrated debugger. By the end of this guide, you will have IDLE installed and running on Ubuntu, ready for Python development.

Update Ubuntu Before Installing IDLE Python

First, update your package lists and upgrade existing packages before installing new software. This ensures you have the latest security patches and that APT can locate the correct package versions.

sudo apt update && sudo apt upgrade

Install IDLE Python via APT

Ubuntu offers two installation approaches for IDLE: the idle meta-package that automatically matches your system’s default Python version, or version-specific packages if you need IDLE for a particular Python release.

Option 1: Install the Default IDLE Meta-Package (Recommended)

The simplest approach installs IDLE matched to your system’s default Python version. This method provides the idle command and creates a desktop application entry automatically.

sudo apt install idle

On Ubuntu 24.04 LTS, this installs IDLE for Python 3.12. On Ubuntu 22.04 LTS, it installs IDLE for Python 3.10. The meta-package ensures compatibility with your existing Python environment.

Option 2: Install a Specific IDLE Python Version

Alternatively, if you need IDLE for a specific Python version, first check which versions are available in your repositories:

apt-cache search idle-python

Expected output on Ubuntu 24.04 LTS:

idle-python3.12 - IDE for Python (v3.12) using Tkinter

Expected output on Ubuntu 22.04 LTS:

idle-python2.7 - IDE for Python (v2.7) using Tkinter
idle-python3.10 - IDE for Python (v3.10) using Tkinter
idle-python3.11 - IDE for Python (v3.11) using Tkinter

Next, install the specific version you need. For example, on Ubuntu 24.04:

sudo apt install idle-python3.12

When installing a version-specific package like idle-python3.12, the launch command is idle-python3.12, not idle. Only the idle meta-package creates the generic idle command.

Once the installation completes, verify the version-specific IDLE is available:

which idle-python3.12

Expected output:

/usr/bin/idle-python3.12

Verify Meta-Package Installation

If you installed the idle meta-package (Option 1), verify the installation completed successfully by checking its location:

which idle

Expected output confirming IDLE is ready to use:

/usr/bin/idle

Launch IDLE Python

Launch from Terminal

Once installed, start IDLE from the terminal. If you installed the idle meta-package, use:

idle

If you installed a version-specific package, use the corresponding command:

idle-python3.12

Launch from Applications Menu

For desktop users, IDLE appears in your applications menu after installation. On GNOME, follow these steps:

  1. Click Activities at the top left corner of your screen.
  2. Type IDLE in the search bar or click Show Applications.
  3. Click the IDLE icon to launch.

Getting Started with IDLE Python

When IDLE opens, you see the Python Shell window—an interactive interpreter where you can type Python commands and see results immediately. Here are a few tips for new users:

  • Create a new script: Press Ctrl+N to open a new editor window where you can write and save Python files.
  • Run your script: With a script open, press F5 to execute it in the shell window.
  • Use auto-completion: Type part of a function or variable name and press Tab or Ctrl+Space to see suggestions.
  • Access the debugger: From the menu, select Debug > Debugger to enable step-through execution.

For more advanced Python development, consider exploring virtual environments on Ubuntu to isolate project dependencies, or install pip for Python package management. Additionally, the official IDLE documentation covers advanced features like debugging, stack viewer, and class browser in detail.

Manage IDLE Python

Update IDLE Python

IDLE receives updates through Ubuntu’s standard package management. To update IDLE along with all other system packages, run:

sudo apt update && sudo apt upgrade

This command refreshes your package lists and upgrades all installed packages to their latest available versions, including IDLE and its dependencies.

Remove IDLE Python

If you no longer need IDLE, remove it along with its configuration files and orphaned dependencies. First, if you installed the idle meta-package, use the purge option to remove both the package and its configuration:

sudo apt remove --purge idle

Alternatively, if you installed a version-specific package, use the corresponding name:

sudo apt remove --purge idle-python3.12

Next, remove orphaned dependencies that were installed alongside IDLE but are no longer needed:

sudo apt autoremove

This cleans up packages like python3-tk, Tk libraries, fonts, and X11 dependencies that were only required by IDLE.

IDLE stores user preferences in ~/.idlerc/. If you want to remove these settings as well, delete the directory:

rm -rf ~/.idlerc

Finally, verify the removal succeeded:

which idle

If the command returns no output, IDLE has been successfully removed from your system.

Conclusion

You now have IDLE installed on Ubuntu and can use the interactive shell, script editor, and built-in debugger for Python development. The idle meta-package approach ensures version compatibility with your system Python, while version-specific packages like idle-python3.12 provide targeted installations when needed. For larger projects requiring advanced features like Git integration, terminal access, or extensive plugin ecosystems, explore PyCharm on Ubuntu or Visual Studio Code on Ubuntu as full-featured alternatives.

Leave a Comment