by Leodanis Pozo Ramos Publication date Feb 18, 2026 Reading time estimate 26m basics best-practices tools
To learn how to install Python on your system, you can follow a few straightforward steps. First, check if Python is already installed by opening a command-line interface and typing python --version or python3 --version.
You can install Python on Windows using the official installer from Python.org or through the Microsoft Store. On macOS, you can use the official installer or Homebrew. For Linux, use your package manager or build Python from source.
By the end of this tutorial, you’ll understand how to:
python --version or python3 --version in a command-line interface.pyenv to keep them separate.This tutorial covers installing the latest Python on the most important platforms or operating systems, such as Windows, macOS, Linux, iOS, and Android. However, it doesn’t cover all the existing Linux distributions, as that would be a massive task. Nevertheless, you’ll find instructions for the most popular distributions available today.
To get the most out of this tutorial, you should be comfortable using your operating system’s terminal or command line.
Take the Quiz: Test your knowledge with our interactive “How to Install Python on Your System: A Guide” quiz. You’ll receive a score upon completion to help you track your learning progress:
Interactive Quiz
How to Install Python on Your System: A Guide
In this quiz, you'll test your understanding of how to install or update Python on your computer. With this knowledge, you'll be able to set up Python on various operating systems, including Windows, macOS, and Linux.
In this section, you’ll learn to check whether Python is installed on your Windows operating system (OS) and which version you have. You’ll also explore three installation options that you can use on Windows.
For a more comprehensive guide on setting up a Windows machine for Python programming, check out Your Python Coding Environment on Windows: Setup Guide.
To check whether you already have Python on your Windows machine, open a command-line application like PowerShell or the Windows Terminal.
Follow the steps below to open PowerShell on Windows:
PowerShell.Alternatively, you can right-click the Start button and select Windows PowerShell or Windows PowerShell (Admin). In some versions of Windows, you’ll find Terminal or Terminal (admin).
With the command line open, type in the following command and press the Enter key:
Using the --version switch will show you the installed version. Note that the 3.x.z part is a placeholder here. In your machine, x and z will be numbers corresponding to the specific version you have installed.
Alternatively, you can use the -V switch:
You can also use the py launcher, which is the Python launcher for Windows and is especially helpful if you plan to work with multiple Python versions:
Using the python --version, python -V, or py --version command, you can check whether Python is installed on your system and learn what version you have. If Python isn’t installed on your OS, you’ll get an error message.
Python 3.14 introduced the Python Install Manager, which is a modern installation system that handles version management and automatic updates. This new tool is available through the Microsoft Store and Python.org. It’ll replace the traditional installer that’s been deprecated and won’t be produced for Python 3.16 or later.
You’ll have different options to install Python on a Windows machine:
In this section, you’ll focus on only the first two options, which are the most popular ones on Windows environments.
If you want to install Python in the WSL, you can read the Linux-related sections of this tutorial after installing the Linux distribution of your choice.
If you’re looking for the quickest and most modern installation approach, then you can install Python from the Microsoft Store. For Python 3.14+, the Microsoft Store delivers the Python Install Manager, which provides automatic updates and integrated version management.
This Python package from the Microsoft Store is identical to the traditional version from Python.org, with the same features and capabilities. According to the official Python documentation, both versions provide a full Python installation suitable for development and production use.
The main advantage of the Microsoft Store version is convenience because it integrates with Windows’ app management system and handles updates automatically.
Open the Microsoft Store application on your Windows machine and search for the Python Install Manager app. Select the app to navigate to its page.
Once you’re there, you’re ready to start with the installation process.
After you’ve selected the Python Install Manager app, follow these steps to complete the installation:
When you click the Open button, you’ll be presented with a terminal window. Follow the on-screen instructions to complete the installation.
Once the installation is complete, open Windows PowerShell and run the python --version command to confirm that Python is installed on your machine. Note that the installation will reside in your user folder, so you don’t need admin privileges to complete the process.
Along with the Python interpreter, you can access a few other tools, including the py launcher, pip, and IDLE!
The traditional installer from Python.org has been the standard installation method for many years. According to the official Python documentation, this installer is:
[…] deprecated since 3.14 and will not be produced for Python 3.16 or later (Source)
With the Python Install Manager recommended as the modern replacement. However, understanding this installation process is still valuable, especially if you’re working with existing Python installations or earlier versions.
In this section, you’ll go through the necessary steps to install Python using the traditional installer from Python.org.
Follow the steps below to download the traditional Python installer from the Python.org site:
When you finish downloading the installer, then you can move on to the next step.
Once you’ve chosen and downloaded an installer, run it by double-clicking on the file. An installation wizard like the one below will appear on your screen:
There are a couple of things to notice about the wizard’s initial window:
C:\Program Files\Python314\ directory, which will require admin privileges.pip, IDLE, the test suite, and the py launcher. It also allows you to decide whether you want to install Python for all users, which requires admin privileges.You can also customize some advanced options, including file association, shortcuts creation, adding Python to the system environment variables, and even using a custom install location if you don’t have admin privileges.
As you can conclude, the Python installer gives you granular control over the installation process on Windows.
Use the options in the dialog box to customize the installation to meet your needs. Then click Install. That’s it! You now have the latest version of Python on your Windows machine!
If you’re curious to know where the installation is located, then use the where.exe command in PowerShell:
Note that the where.exe command will work only if Python has been installed for your user account.
Python comes preinstalled on macOS. However, the installed version may not be the most recent one. To take advantage of Python’s latest features, you’ll need to download and install newer versions alongside the system one. Note that Python 3.14 requires macOS 10.15 Catalina or later to work properly.
To check which Python version you have on your Mac, open a command-line application like Terminal.
Here’s how you open Terminal on macOS:
Terminal.Alternatively, you can open Finder and navigate to Go → Utilities → Terminal.
With the command line open, type in the following commands:
This command will respond with a version number. Alternatively, you can use the shorter -V switch, which has the same effect.
In practice, you’d want to get the latest version of Python if none of the above commands returns a version number or if you have a version of Python 3 that isn’t the latest available. Now, you can read through the following sections to learn about the different options for installing Python on macOS.
You’ll have two main options to install Python on macOS:
The official Python installer and the Homebrew Python distribution will work, but the Python Software Foundation maintains only the official installer.
Now that you know your options for installing Python on macOS, it’s time to get your hands dirty and go through the installation process.
The recommended and most reliable option for installing Python in macOS is to use the official installer from Python.org. This installer includes all the system dependencies you’d need to develop full-fledged applications with Python.
You can install Python in two steps using the official installer:
When the download is finished, move on to the next step.
Run the installer by double-clicking the downloaded file or by clicking the file in the Dock’s Downloads icon. You’ll see a window like the following:
Follow these on-screen steps to complete the installation:
You now have the latest version of Python on your macOS computer, and you’re ready to start coding cool apps!
The Homebrew package manager is another good option for installing Python on macOS. You can install Python using the Homebrew package manager in two steps, but first, you need to be aware of some limitations of the Python package on Homebrew.
The Python distribution available on Homebrew doesn’t include the Tcl/Tk dependency, which is required by the Tkinter module. Tkinter is the standard library module for developing graphical user interfaces in Python and is an interface for the Tk GUI toolkit, which isn’t part of Python.
Homebrew doesn’t install the Tk GUI toolkit dependency. Instead, it relies on an existing version installed on your system. The system version of Tcl/Tk may be outdated or missing entirely and could prevent you from using Tkinter.
Finally, note that the Python distribution on Homebrew isn’t maintained by the Python Software Foundation and could change at any time.
If you already have Homebrew installed on your macOS system, then you can skip this step. If you don’t have it installed, then use the following procedure:
Depending on your internet connection speed, the process may take a few minutes to download all of Homebrew’s required files. Once the installation is complete, you’ll be back at the shell prompt in your terminal window.
Now that Homebrew is installed, you’re ready to install Python.
Installing Python with the Homebrew package manager is now as straightforward as running the following command:
This command will download, install, and set up the latest version of Python on your machine. You can make sure everything went correctly by testing if you can access Python from the terminal. If you get an error message, then go through the install steps again to make sure you have a working installation.
In this section, you’ll learn how to check which version of Python, if any, is on your Linux computer. You’ll also learn about the installation options to get the latest Python on Linux systems.
Most Linux distributions come with Python installed by default. In most cases, the installed version won’t be the latest Python. To find out which version of Python you have on Linux, open a terminal window and run the following command:
If you have Python on your machine, then this command will respond with a version number. Instead of --version, you can use the shorter -V switch:
Either of these switches will give you the version number of the Python installation that the command is associated with. If your current version is outdated, you’ll want to get the latest version of Python.
There are two main ways to install the official Python distribution on a Linux operating system:
Not every Linux distribution has Python in their package repository. So, depending on your distribution, building Python from source code might be your only option.
If your Linux distribution includes Python in its list of available packages, you may realize that the version in the repository isn’t the latest version available on Python.org. In this situation, your only option to have the latest version is to build it from the source.
If you have a rolling release Linux distribution like Arch, Manjaro, openSUSE Tumbleweed, and others, then you’ll probably have the latest version of Python available for installation or update using the system’s package manager. In this situation, to update your Python, you’d only have to update the system with the appropriate commands.
The installation option boils down to whether your Linux has Python available in its software repository and whether you need to control the details of the installation.
You’ll have at least three reasons to choose to build Python from source code:
You can run the steps in the following sections to complete the installation on your Linux machine.
To start, you need to clone the CPython repository from GitHub or get the Python source code from Python.org. If you go to the downloads page, then you’ll find the latest source for Python 3 at the top.
When you select the latest Python version, you’ll see a Files section at the bottom of the page. Select Gzipped source tarball and download it to your machine.
If you prefer to use your command line, then you can use wget to download the file to your current directory:
For this command to work, you must specify the version to download. When the tarball finishes downloading, there are a few things you’ll need to do to prepare your system for building Python.
There are a few distro-specific steps involved in building Python from source. The goal of this section is to prepare your system for building Python. Below, you’ll find specific steps for some popular Linux distributions.
First, update the list of available packages and upgrade them using the following commands:
Note that because you’re using the sudo command, you’ll be prompted to provide your root password.
Next, make sure you have all of the build requirements installed:
It’s okay if you already have some of these requirements installed on your system. You can execute the above commands, and any existing packages will be skipped.
Building from source is the most reliable way to install Python on openSUSE. To do that, you’ll need to install the development tools, which can be done in YaST via the menus or by using the zypper command as shown below:
This might take a while to complete as it installs several packages. So, feel free to grab a coffee and relax.
To prepare your Fedora system for building Python from sources, you should first update the system with the dnf package manager:
Once dnf finishes updating, you can install the necessary build dependencies with the following commands:
These commands will download and install all the required tools for compiling Python from its source code.
Once you have your system ready and the TAR file with the Python source code, you can unpack the source into a directory:
This command unpacks the source code into a directory named after the TAR file. Note that the TAR file will show a specific Python version rather than 3.x.z in your output.
Now you need to run the ./configure script to prepare the build:
The --enable-optimizations flag will enable some optimizations within Python to make it run faster. Doing this may add twenty or thirty minutes to the compilation time. The --with-ensurepip=install flag will install pip bundled with this installation.
Next, you build Python using the make command. The -j option allows you to tell make to split the building into parallel steps to speed up the compilation. Even with the parallel builds, this step can take several minutes:
Finally, you have to install your compiled version of Python. You’ll use the altinstall target here to avoid overwriting the system Python. You’ll need to run the following command as root:
The installation might take a while to finish. Once done, you can verify that Python is set up correctly.
Test that the command below returns the compiled version of Python:
Again, in your case, this command would need to be run using the specific version number.
You can also run the Python test suite to ensure everything works properly on your system. To do this, execute the following command:
You’ll probably want to find something else to do for a while, as your computer will be running tests for some time. If all the tests pass, then you can be confident that your brand-new Python build will work as expected!
The Pythonista app for iOS is a full-fledged Python development environment that you can run on your iPhone or iPad. It features a Python editor, technical documentation, and an interpreter, all rolled into a single app.
Pythonista is surprisingly fun to use. It’s a great little tool when you’re stuck without a laptop and want to work on your Python skills on the go. It comes with the complete Python standard library and includes full documentation you can browse offline.
To set up Pythonista, you need to download it from the iOS app store.
If you have an Android tablet or phone and want to practice Python on the go, then you have several options available.
For example, Pydroid 3 features an interpreter that you can use for REPL sessions. It also allows you to edit, save, and execute Python code. It has a free version and also a paid Premium version that supports code prediction and code analysis.
If you want to try out Python without installing it on your machine, then you’ll find several websites offering an online Python interpreter and some related functionalities. Here’s a quick list of these tools:
These online Python interpreters may not be able to execute complex code, but they should be adequate for basic code examples, which could be a nice way to get started.
You now know how to install the latest version of Python on your operating system. Your Python programming journey is just beginning.
In this tutorial, you’ve learned how to:
You’re now ready to get started programming in Python! If you’re starting to build your Python skills, check out Python Basics: A Practical Introduction to Python 3, which will take you from beginner to intermediate level.
If you want a structured learning path to grow as a Python developer, then check out the Real Python Learning Paths, which include in-depth tutorials, hands-on projects, video courses, quizzes, and more.
Take the Quiz: Test your knowledge with our interactive “How to Install Python on Your System: A Guide” quiz. You’ll receive a score upon completion to help you track your learning progress:
Interactive Quiz
How to Install Python on Your System: A Guide
In this quiz, you'll test your understanding of how to install or update Python on your computer. With this knowledge, you'll be able to set up Python on various operating systems, including Windows, macOS, and Linux.
Now that you have some experience with installing Python on your system, you can use the questions and answers below to check your understanding and recap what you’ve learned.
These FAQs are related to the most important concepts you’ve covered in this tutorial. Click the Show/Hide toggle beside each question to reveal the answer.
You can check if Python is installed by opening your terminal or command prompt and typing python --version or python3 --version. If Python is installed, you’ll see a version number.
On Windows, you can use the official Python installer or the Microsoft Store. On macOS, you can use the official installer or Homebrew. On Linux, you can install Python from your package manager or build it from source.
To upgrade Python, download the latest version from Python.org and install it over your existing version, or use your system’s package manager to update Python to the latest version available.
Yes, you can install multiple versions of Python on the same machine by using tools like pyenv on macOS and Linux, or pyenv-win on Windows, to manage different versions.
You can manage Python environments and versions using tools like venv for creating virtual environments and pyenv for managing multiple Python versions on your system.