Website Vidya
WordPressStep-by-Step Guide

Fix WordPress asking for FTP Credentials - 7 Simple Steps

If you're a WordPress user, chances are high that at some point, you’ve come across the frustrating and confusing "Connection Information" screen. This prompt typically appears when you try to install or update a plugin, theme, or the WordP...

RR
Website Vidya TeamLead Systems Educator
Published:
12 min read
Fix WordPress asking for FTP Credentials - 7 Simple Steps
AI Executive SummaryCORE CIS AI

12 min read

If you're a WordPress user, chances are high that at some point, you’ve come across the frustrating and confusing "Connection Information" screen. This prompt typically appears when you try to install or update a plugin, theme, or the WordP...

Key Highlights
  • Prerequisites
  • How to Install Python on Ubuntu 24.04 LTS
  • Conclusion
Grounded in full engineering runbookCORE CIS Ai Engine

Python is one of the most popular programming languages today, widely used in web development, data science, machine learning, automation, and more. Ubuntu 24.04 LTS (Long Term Support) comes with Python pre-installed, but often you might want to install a specific Python version, upgrade to the latest release, or configure your system for Python development environments.

This article will guide you step-by-step on how to install Python on Ubuntu 24.04 LTS using several methods, from the easiest default package installation to building Python from source. It also covers pip installation, creating virtual environments, and managing multiple Python versions for developers.


Prerequisites

Before starting the installation, ensure you have:

  • An Ubuntu 24.04 LTS system (local machine or server).
  • A non-root user with sudo privileges.
  • A stable internet connection to download packages and dependencies.
  • Basic knowledge of using the terminal/command line interface.

How to Install Python on Ubuntu 24.04 LTS


Step 1: Update Your System

It’s always recommended to start by updating your system packages to their latest versions to avoid issues during installation. Open your terminal and run:

sudo apt update -y && sudo apt upgrade -y

This command will update the package list and upgrade existing packages, keeping your system fresh and secure.


Step 2: Check Existing Python Version

Ubuntu 24.04 usually comes with Python 3.12 pre-installed. Verify the installed Python version on your system with:

python3 --version

You should see an output similar to:

Python 3.12.3

If Python is not installed or you want a different version, proceed to the next steps.


Step 3: Install Python Using APT (Default Repository)

The easiest method to install Python on Ubuntu 24.04 is using the APT package manager since Python 3 is included by default in the Ubuntu repositories.

To install Python 3, run:

sudo apt install python3

This will install the default Python 3 version available in the repository (typically the latest stable release like 3.12.x). Verify the installation again with:

python3 --version

Step 4: Install Specific Python Versions Using Deadsnakes PPA

If you want a specific Python version that’s not in the default Ubuntu repo (e.g., Python 3.10, 3.11), you can use the third-party Deadsnakes PPA repository, which hosts multiple Python versions.

Install software-properties-common which allows adding PPAs:

sudo apt install software-properties-common -y

Add the Deadsnakes PPA:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update

Install a specific Python version, for example, Python 3.11:

sudo apt install python3.11

Verify the installed version:

python3.11 --version

Step 5: Install Python from Source (Advanced)

Installing Python from source lets you get the absolute latest version or customize the build options.

Install build dependencies:

sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev pkg-config wget -y

Download the latest Python source code (replace 3.12.4 with the latest available version):

wget https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz

Extract the tarball:

tar -xf Python-3.12.4.tgz
cd Python-3.12.4

Configure the build with optimizations for faster execution:

./configure --enable-optimizations

Compile and install (this may take several minutes):

make -j $(nproc)
sudo make altinstall

The altinstall avoids overwriting the system default Python.

Verify installed Python version:

python3.12 --version

Step 6: Install Pip for Python Package Management

Pip is the official package installer for Python, enabling you to install and manage additional Python libraries easily.

To install pip for the system Python version, run:

sudo apt install python3-pip -y

Check pip version with:

pip3 --version

If you installed a specific Python version via PPA or source and want pip, sometimes manual installation is needed:

sudo apt install python3.12-distutils
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3.12 get-pip.py

Step 7: Setup Python Virtual Environments

Virtual environments let you create isolated Python environments, useful to maintain dependencies per project without conflicts.

Install the virtual environment package for your Python version:

sudo apt install python3-venv

For specific Python versions (e.g., 3.12):

sudo apt install python3.12-venv

Create a virtual environment:

python3 -m venv myenv

Replace myenv with your desired environment name.

Activate the virtual environment:

source myenv/bin/activate

Your terminal prompt will change indicating the environment is active. You can install packages there separately with pip.

To deactivate:

deactivate

Step 8: Managing Multiple Python Versions

When multiple versions are installed, use the full version command (e.g., python3.11) or set the default Python version via the update-alternatives system:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
sudo update-alternatives --config python3

Choose the desired default Python version interactively.


Step 9: Remove Python Versions (If Needed)

To remove Python installed via APT or PPA:

sudo apt purge python3* -y

For source installations, manually delete the installed folders and symbolic links:

sudo rm -rf /usr/local/lib/python3.12
sudo rm /usr/local/bin/python3.12

Conclusion

Installing Python on Ubuntu 24.04 LTS is straightforward with multiple options catering to various use cases:

  • Use APT for quick installation of default Python versions.
  • Use Deadsnakes PPA for specific or newer versions.
  • Build from source for full control over Python builds.
  • Pip and virtual environments empower effective package and project management.

By following these steps, anyone can set up a robust Python environment on Ubuntu 24.04 for development, scripting, or production workloads efficiently.


Written by

Website Vidya Team

Technology educator and researcher at Website Vidya.

Discussion

0
Share your thoughts, ask a question, or suggest a tip...
Write →

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

WordPress•

How to Create a Table of Contents in WordPress

How to create a table of contents in WordPress? Did you ever want to add a table of contents just like Wikipedia has on its website? If yes, I’m going to show you a way that you use to put a similar table of contents box on your blog or web...

RR
Rajesh Rai
Read More
WordPress•

How to Upload SVG to WordPress - 3 Easy Methods

Do you want to embed SVG in the WordPress website? Learn how to upload SVG to WordPress effortlessly with 3 simple methods. Enhance your website with captivating graphics. This how-to guide is for all levels. By default, the WordPress conte...

RR
Rajesh Rai
Read More
WordPress•

How to Hide or Remove the WordPress Admin Toolbar

WordPress displays a toolbar at the top of every page by default. Whether you are viewing your website’s admin dashboard or any page, you will find this WordPress toolbar on every page and it is very annoying for most of the people. Moreove...

RR
Rajesh Rai
Read More