Share your love
Install Python 3.13 on Fedora Linux

This guide from the Orcacore website will teach you how to install Python 3.13 on Fedora Linux and create and run a sample project with Python 3.13. As described on the official Python website, Python 3.13 is the latest stable release of the Python programming language, with a mix of changes to the language, the implementation, and the standard library.
If you need a quick and dependable place to run your Python projects, I suggest using a Fedora Linux VPS. It works well with the latest tools and gives you a smooth experience while coding and testing. You can click here to get your Fedora VPS and start building your projects right away.
You can now proceed to the rest of the article to start your Python 3.13 installation on Fedora Linux.
Table of Contents
Easy and Full Steps To Set up Python 3.13 on Fedora Linux
Before you start the Python 3.13 setup, be sure you have access to your Fedora Linux server as a non-root user with sudo privileges. Then, follow the steps below to complete this guide.
Step 1. Install Required Packages for Python 3.13 on Fedora
First, you must run the system update and upgrade with the following command:
sudo dnf update -y && sudo dnf upgrade -y
Then, use the following commands to install required packages and development tools on Fedora Linux:
# sudo dnf install gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make tar -y
# sudo dnf groupinstall "Development Tools" -y
Step 2. Download Python 3.13 Package From Source
To get the latest release, you must visit the Python Source Releases page and copy the latest source tarball package. Then, use the following wget command to download it:
sudo wget https://www.python.org/ftp/python/3.13.3/Python-3.13.3.tgz

When your download process is completed, use the following command to extract your file:
sudo tar -xf Python-3.13.3.tgz
Next, switch to your Python 3.13 directory with the command below:
cd Python-3.13.3
Step 3. Build and Install Python 3.13 on Fedora Linux
Now you can start your Python 3.13 building and installing process. You must be sure that all the dependencies work correctly for Python 3.13 on Fedora Linux. For this purpose, run the command below:
sudo ./configure --enable-optimizations
Once it is completed, you will get the following output:

Also, you must check your system cores by using the command below:
sudo nproc
Example Output
4
Now you can start to build Python 3.13 by using the command below and define your number of cores with the -j option:
sudo make -j 4
This will take some time to complete.
Then, use the command below to install Python 3.13 on Fedora Linux:
sudo make altinstall
You can now verify Python 3.13 by checking its version:
python3.13 --version
Output
Python 3.13.3
Step 4. Create a Python 3.13 Sample Project (Calculator Module)
At this step, we want to create a simple calculator module with functions (add, subtract), and test it using Python’s unittest framework. First, create a project directory and switch to it with the commands below:
# sudo mkdir sample_project
# cd sample_project
Then, use the following commands to create folder structures:
# mkdir -p src/sample
# mkdir tests
# touch src/sample/__init__.py
# touch src/sample/calculator.py
# touch tests/test_calculator.py
Now you must add the Calculator Logic, which contains two basic math functions. Open the file with your desired text editor, like Vi Editor or Nano Editor, and add the following functions to the file.
sudo vi src/sample/calculator.py
Add the functions:
def add(a, b):
"""Return the sum of a and b."""
return a + b
def subtract(a, b):
"""Return the difference of a and b."""
return a - b
Once you are done, save and close the file.
Next, you must write Unit Tests. Open the following file and add the Python built-in unittest module.
sudo vi tests/test_calculator.py
Write Unit Tests:
import unittest
from sample.calculator import add, subtract
class TestCalculator(unittest.TestCase):
def test_add(self):
self.assertEqual(add(2, 3), 5)
def test_subtract(self):
self.assertEqual(subtract(5, 3), 2)
if __name__ == '__main__':
unittest.main()
Once you are done, save and close the file. This checks that our functions return correct results.
At this point, you need to create a pyproject.toml with the command below:
sudo vi pyproject.toml
Add the following content to the file:
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "sample"
version = "0.1.0"
description = "A sample Python project"
authors = [
{ name = "Your Name", email = "your@email.com" }
]
readme = "README.md"
requires-python = ">=3.13"
When you are finished, save and close the file. This file defines your project metadata and how it should be built.
Finally, you can create a Python virtual environment and run your project. To set up the Python virtual environment and activate it, run the following commands:
# sudo python3.13 -m venv venv
# source venv/bin/activate
# pip install -e .
Note: -e .
means “editable mode”, so changes to your source files reflect immediately without reinstalling.
You can now use unittest to discover and run all tests with the command below:
python3.13 -m unittest discover tests
In your output, you will see:

Note: Each dot (.) means a test passed.
That’s it, you are done.
Conclusion
Installing Python 3.13 on Fedora Linux is simple and gives you access to the latest features in Python. Once you have installed it, you can easily create a small project with organized code and tests. Using tools like unittest and pyproject.toml helps you follow best practices.
Hope you enjoy it. Please subscribe to us on Facebook, X, and YouTube.
You may also like to read the following articles:
Install CMake on Fedora 39 From the Command Line
Download and Install Oracle JDK 21 on Fedora
Install Bitwarden Password Manager on Fedora
Install and Configure ProFTPD Over TLS/SSL on Ubuntu 24.04
FAQs
What is a Python virtual environment?
A virtual environment keeps your project’s Python packages separate. It avoids conflicts and makes things easier to manage.
Why use Fedora Linux for Python development?
Fedora has up-to-date packages, strong Python support, and is great for developers who want the latest tools.
What is pyproject.toml?
It’s a modern way to describe your Python project’s settings, version, and dependencies.