How to install Python on Fedora 43

Cover Image

Hey Fedora fans! Want to get Python running on your brand new Fedora 43 system? You're in the right place! This guide will walk you through the simplest and most reliable ways to install Python, so you can start coding in no time. Let's dive in!

Method 1: Using DNF (The Recommended Way)

Fedora comes with a powerful package manager called DNF (Dandified Yum), and it's the easiest way to install Python. Here's how:

  1. Open your terminal: You can usually find it in your applications menu, or you can press Ctrl + Alt + T.
  2. Update your system: This is always a good idea before installing new software. Run the following command: sudo dnf update

    You'll probably be asked for your password, which is normal.

  3. Install Python 3: Fedora usually comes with Python 3 pre-installed, but let's make sure it's there and up-to-date. Use this command: sudo dnf install python3
  4. Verify the installation: Type python3 --version in your terminal. You should see the Python version number printed, like Python 3.12.x. Great! You're all set with Python 3!

Method 2: (If You Need Python 2 - Not Recommended Anymore)

While Python 3 is the current standard and generally preferred, there might be rare cases where you need Python 2. However, please note that Python 2 is officially end-of-life and no longer receives updates. Use this method with caution and only if absolutely necessary.

To install Python 2 (again, be aware of the implications!), you'll use DNF again:

  1. Open your terminal: Just like before.
  2. Install Python 2: The package name for Python 2 is usually python2. Run this command: sudo dnf install python2
  3. Verify the installation: Type python2 --version in your terminal. You should see something like Python 2.7.x.

Important Note: Using Python 2 is generally discouraged unless you have a specific reason to. Modern libraries and frameworks are usually designed for Python 3. Stick with Python 3 if you can!

Managing Multiple Python Versions

If you have both Python 2 and Python 3 installed, you might need to be explicit about which version you're using. That's why we use python3 or python2 in the commands. You can also use virtual environments to isolate your Python projects and their dependencies. We'll cover virtual environments in a future blog post!

That's It!

Installing Python on Fedora 43 is pretty straightforward with DNF. Now you can start writing Python code, explore different libraries, and build amazing applications. Happy coding!