Last modified: May 26, 2025 By Alexander Williams
Install Python on Fedora Easily
Fedora is a popular Linux distribution. Installing Python on Fedora is simple. This guide covers multiple methods.
Table Of Contents
Check Pre-Installed Python
Fedora usually comes with Python pre-installed. Verify using the terminal.
python3 --version
Python 3.11.5
If Python is missing, proceed with installation.
Install Python Using DNF
Fedora uses DNF as its package manager. Update the system first.
sudo dnf update
Install Python with this command.
sudo dnf install python3
Confirm the installation.
python3 --version
Install Python from Source
For the latest version, compile from source. First, install dependencies.
sudo dnf groupinstall "Development Tools"
sudo dnf install openssl-devel bzip2-devel libffi-devel
Download Python from the official site. Replace X.X.X with the version.
wget https://www.python.org/ftp/python/X.X.X/Python-X.X.X.tgz
tar -xf Python-X.X.X.tgz
cd Python-X.X.X
Configure and install.
./configure --enable-optimizations
make -j $(nproc)
sudo make altinstall
Check the installed version.
pythonX.X --version
Install pip for Python
pip is Python's package manager. Install it with DNF.
sudo dnf install python3-pip
Verify pip installation.
pip3 --version
For more details, see How to Install pip for Python in 3 Easy Steps.
Set Up a Virtual Environment
Virtual environments isolate Python projects. Install the required package.
sudo dnf install python3-virtualenv
Create and activate a virtual environment.
python3 -m venv myenv
source myenv/bin/activate
Learn more about Python Virtual Environments.
Install Multiple Python Versions
Use pyenv to manage multiple Python versions. Follow this guide for details.
See Install Multiple Python Versions with pyenv.
Conclusion
Installing Python on Fedora is straightforward. Use DNF for default installations. Compile from source for custom versions.
Always verify installations. Use virtual environments for project isolation. For more advanced setups, explore additional tools.