How to install Python on Windows, macOS, and Linux
On Windows, the way you install Python has changed: the recommended tool is now the Python install manager.
Python is a programming language that developers love for its versatility and simplicity. It's a great choice for web development, data science, artificial intelligence, machine learning, and automation, from small scripts to large applications.
If you're new to programming, even installing Python can feel overwhelming. This guide walks you through installing the latest version of Python on Windows, macOS, and Linux, and checking that it works. At the time of writing, the latest version is Python 3.15.
What is Python?#
Python is a high-level, interpreted programming language created by Guido van Rossum and first released in 1991.
Python's design emphasizes readability, with a clean syntax that uses indentation instead of braces to structure code. That makes it easy to learn for beginners, and pleasant to use for experienced programmers.
Python comes with a large standard library, and the Python Package Index (PyPI) offers hundreds of thousands of third-party packages, so you can build almost anything without starting from scratch. Python runs on Windows, macOS, and Linux, and it's developed by an active community, with a new version released every year.
Who uses Python?#
Python is used across many professions and industries:
- Software developers use it to build applications, from command-line tools to desktop apps and backend services.
- Data scientists and analysts use it to clean, analyze, and visualize data, with libraries such as pandas and Matplotlib.
- Machine learning and AI engineers use it to train and run models, with libraries such as PyTorch and scikit-learn.
- System administrators and DevOps engineers use it to automate tasks, manage servers, and write deployment scripts.
- Web developers use frameworks such as Django, Flask, and FastAPI to build web applications and APIs.
- Researchers and scientists use it to process data, run simulations, and build mathematical models.
Many well-known companies use Python too, including Instagram, whose backend is built on Django, Dropbox, Netflix, Spotify, and Reddit.
Advantages of using Python#
Python's popularity comes from a few key advantages:
- It's easy to learn. Python's syntax is clear and concise, so beginners can start writing useful code quickly.
- It has a huge ecosystem. Libraries for web development, data analysis, machine learning, automation, and much more are a
pip installaway. - It's cross-platform. The same Python code runs on Windows, macOS, and Linux, usually without changes.
- It has a strong community. You'll find tutorials, answers, and libraries for almost any problem, and the language keeps improving every year.
Before you install Python#
You don't need much to install Python:
- A supported operating system: Python 3.15 supports Windows 10 and newer, and the python.org installer for macOS supports macOS 10.15 Catalina and newer. On Linux, any current distribution works.
- Administrator access, on macOS and Linux, to install software system-wide. On Windows, the Python install manager installs for your user account.
- Basic familiarity with the command line, since you'll check your installation in a terminal. If you're new to it, see our guide to Python commands.
- An internet connection to download Python.
Python itself is small, and any computer from the last decade can run it. You'll need more memory and disk space only for heavy workloads, such as data science or machine learning.
Python 2 vs Python 3#
You might still see references to Python 2. It reached its end of life in January 2020, and its last release was Python 2.7.18. It no longer receives updates or security fixes, so always install Python 3. All the instructions below install Python 3.
How to install Python on Windows#
On Windows, the way you install Python has changed: the recommended tool is now the Python install manager. It installs Python and keeps it up to date, and it can manage several Python versions side by side. The traditional installer is deprecated.
Step 1: install the Python install manager#
You can install the Python install manager in one of three ways:
-
Microsoft Store: Open the Microsoft Store app, search for "Python install manager," and click Install.
-
python.org: Go to the Python downloads for Windows page, download the Python install manager, and double-click the file to install it.
-
WinGet: Open a terminal, such as PowerShell in Windows Terminal, and run:
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
If you installed Python with the old installer before, uninstall it first in Settings > Apps > Installed apps, especially the "Python Launcher," because the old launcher and the install manager both provide the py command.
Step 2: install Python#
Open a new terminal window and type:
pythonIf no version of Python is installed yet, the install manager downloads and installs the latest release automatically, then starts the Python shell. Type exit to leave it.
You can also install a specific version with the py command, and list the versions you have:
py install 3.15
py listStep 3: verify the installation#
In the terminal, check the version:
python --versionYou should see the version you installed, such as Python 3.15.2. You're ready to start writing Python on Windows.
The first time you run it, the install manager may also offer to run a configuration check, for example, to add its commands to your PATH. Accept the suggested changes, or run py install --configure later to check again.
How to install Python on macOS#
macOS doesn't include a current version of Python. It no longer ships Python 2, and the python3 command you may find in the Terminal belongs to Apple's Command Line Tools, which install an older Python 3. To get the latest version, install Python from python.org or with Homebrew.
Step 1: check whether Python is installed#
Open the Terminal app. You can find it with Spotlight (Cmd + Space) or in Applications > Utilities. Then type:
python3 --versionIf you see a recent version, such as Python 3.15.2, you're done. If you see an older version, or macOS asks you to install the Command Line Tools, continue with the next step.
Step 2: download and run the installer#
Go to the Python downloads for macOS page and download the macOS installer for the latest release. It's a .pkg file that runs natively on both Apple Silicon and Intel Macs.
Open the downloaded file and follow the steps: accept the license, keep the default install location, and enter your password when asked.
When the installation finishes, a Finder window opens the Python 3.15 folder in Applications. Double-click Install Certificates.command in that folder. It installs the root certificates Python needs to make secure connections, for example, to download packages with pip.
Alternatively, if you use Homebrew, you can install Python with one command:
brew install pythonStep 3: verify the installation#
Open a new Terminal window and type:
python3 --versionYou should see the version you just installed. On macOS, use python3 and pip3, since the python command may not exist.
You can also try IDLE, the simple editor that comes with Python. Open it from the Python 3.15 folder in Applications, and type this in its shell:
print("Test message")Press Enter, and Test message appears on the next line.
How to install Python on Linux#
Most Linux distributions come with Python 3 installed, because many system tools are written in it. But it's often not the latest version, and some parts, such as pip and the venv module, may be in separate packages.
Step 1: check for an existing installation#
Open a terminal and type:
python3 --versionIf Python is installed, you'll see its version. Note that on many distributions, including Debian and Ubuntu, the command is python3, and python doesn't exist unless you install it.
Step 2: install Python with your package manager#
The easiest way to install Python on Linux is with your distribution's package manager.
On Debian, Ubuntu, and Linux Mint:
sudo apt update
sudo apt install python3 python3-venv python3-pipThe extra packages add virtual environments and pip, which Debian and Ubuntu package separately. To also make the python command run Python 3, install python-is-python3.
On Fedora and other RPM-based distributions:
sudo dnf install python3On Arch Linux:
sudo pacman -S pythonThe package manager installs the Python version your distribution provides, which may be a few releases behind the latest one. Don't remove or replace it, since your system's own tools depend on it.
Step 3 (optional): build the latest Python from source#
If you need a newer Python than your distribution provides, you can build it from the source code. This takes a few minutes and some extra packages. These steps work on Debian and Ubuntu:
-
Install the tools and libraries needed to build Python:
sudo apt update sudo apt install build-essential zlib1g-dev libncurses-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev liblzma-dev wget -
Download the source code of the latest release from the Python source releases page, and extract it:
wget https://www.python.org/ftp/python/3.15.2/Python-3.15.2.tgz tar -xf Python-3.15.2.tgz cd Python-3.15.2 -
Configure, build, and install it:
./configure --enable-optimizations make -j "$(nproc)" sudo make altinstallThe
--enable-optimizationsflag makes Python run faster but makes the build take longer.make -j "$(nproc)"builds on all your CPU cores.
Use make altinstall, not make install. altinstall installs the new version as python3.15, next to your system Python, while make install would also overwrite the python3 command, which can break system tools that depend on your distribution's Python.
Step 4: verify the installation#
Check the version with the command for the Python you installed:
python3 --version # Your distribution's Python
python3.15 --version # Python you built from sourceOther ways to install Python#
Besides the official installers and package managers, two popular tools install and manage Python versions for you, on any operating system:
- uv is a fast Python package and project manager. Once you install it,
uv python install 3.15installs Python 3.15 for your projects, without touching your system Python. - pyenv installs several Python versions on macOS and Linux and switches between them, for example, with
pyenv install 3.15. On Windows, use the Python install manager or pyenv-win.
These tools are especially useful when different projects need different Python versions. See our guide to Python commands for more on both.
Summary#
In this article, you installed Python on Windows with the Python install manager, on macOS with the python.org installer or Homebrew, and on Linux with your package manager or from source, and checked that it works in the terminal.
Now that Python is installed, it's time to start learning. Check out our Python tutorials and our guide to Python commands, and bookmark Python's official documentation.
When your Python app is ready to go live, you can deploy it from Git with Sevalla's Application Hosting, which detects Python projects and installs their dependencies for you.