How to install Python on Fedora 43

Cover Image

Installing Python on Fedora 43: A Beginner's Guide

Welcome Fedora 43 users! Python is a powerhouse in the automation and development world. Whether you're scripting tasks, building web applications, or diving into data science, Python is an essential tool. This guide will walk you through installing Python on your Fedora 43 system, step-by-step.

Checking if Python is Already Installed

Before we install, let's quickly check if Python is already available. Fedora often comes with Python pre-installed. Open your terminal and type:

python3 --version

If you see a version number (like Python 3.12.0), congratulations! Python is already installed. You can skip to the "Verifying Pip" section. If you get an error message, proceed to the installation steps below.

Installing Python 3

Fedora uses the dnf package manager, which makes installing software a breeze. To install Python 3, run the following command in your terminal:

sudo dnf install python3

You'll be prompted for your password. Enter it and press Enter. dnf will handle the installation process for you.

Once the installation is complete, verify it by typing:

python3 --version

You should now see the installed Python 3 version.

Verifying Pip

pip is the package installer for Python. It allows you to easily install and manage external libraries and modules. It's almost always installed alongside Python. Let's verify its presence and update it to the latest version.

Check pip version using the command below:

pip3 --version

If pip is not installed run:

sudo dnf install python3-pip

To upgrade pip to the newest version, execute the following command:

pip3 install --upgrade pip

Example: Running a Simple Python Script

Let's create a simple Python script to ensure everything is working correctly. Create a new file named hello.py using your favorite text editor (like nano or vim):

nano hello.py

Paste the following code into the file:

print("Hello, Fedora 43!")

Save the file (in nano, press Ctrl+X, then Y, then Enter). Now, run the script:

python3 hello.py

You should see "Hello, Fedora 43!" printed in your terminal. If so, you've successfully installed and configured Python on your Fedora 43 system!

What's Next?

Now that you have Python installed, the possibilities are endless! Here are some ideas to get you started:

  • Explore online Python tutorials (like those on the official Python website).
  • Install popular libraries like requests (for web requests) and NumPy (for numerical computing).
  • Start automating tasks on your Fedora system!

Happy coding!