Programming and digital skills Python Windows macOS Linux venv pip installation

How to Install Python on Windows, macOS, and Linux

Install Python from appropriate sources, verify the interpreter, create a virtual environment, and avoid mixing runtimes or breaking the system Python.

A mentor guides a student through three installation and verification sequences for a programming environment across different operating systems.
· Crezendo

Installing Python is not exactly the same process on Windows, macOS, and Linux. The recommended tooling has also changed over time: on Windows, current Python documentation describes the Python Install Manager as the maintained CPython route; on macOS, python.org publishes signed .pkg installers; and on Linux it is usually better to respect the distribution package manager and avoid blindly replacing the Python used by the operating system itself.

This URL received 6 impressions during the reviewed window for direct searches such as “install Python on Windows” and “Python installation.” The volume is small, but the intent is concrete and Crezendo's main beginner Python guide already links here as a prerequisite. The page therefore remains a separate installation reference rather than being merged into language-learning material.

Before installing: check what already exists

Open a terminal and try the appropriate commands.

On Windows:

py --version
python --version

On macOS or Linux:

python3 --version

Do not assume that python, python3, and py point to the same interpreter. If a command returns a version, record what it is and where it came from before installing another copy.

Also define why you need Python:

  • learning programming;
  • running an existing project;
  • using a version required by a dependency;
  • automating tasks;
  • maintaining software that already defines its environment.

A project that requires Python 3.12 should not automatically be moved to the newest release merely because one exists.

Windows: use the current Python Install Manager

Current Python documentation describes the Python Install Manager as the CPython-maintained approach for Windows. It can be obtained from python.org or the Microsoft Store and can manage Python runtimes over time.

See the current Using Python on Windows documentation before installation.

1. Start from an official source

Begin at python.org/downloads. Avoid third-party download pages that repackage Python with unrelated software.

2. Install the manager and open a fresh terminal

A terminal window that was already open may keep old environment information. After installation, open a new Windows Terminal, CMD, or PowerShell window and check:

py --version

Depending on the configuration, this may also work:

python --version

3. Verify the actual runtime

Inside Python:

import sys
print(sys.executable)
print(sys.version)

sys.executable tells you which interpreter is actually running the program.

macOS: the python.org installer is a direct official option

Current Python documentation explains that the CPython release team publishes .pkg installers for maintained versions of macOS. Current installers use a universal2 build that runs on supported Apple Silicon and Intel Macs.

See Using Python on macOS.

1. Download from python.org

Open python.org/downloads and choose a stable version compatible with your project.

2. Run the .pkg

The package is signed and notarized according to the practices documented by Python.org. Follow the standard macOS installer.

3. Verify from Terminal

python3 --version

To inspect the path:

which python3

The fact that python3 exists does not prove it is the installation you intended to use. Verify both version and path.

What about Homebrew?

Homebrew is another valid route for workflows that already use it, but you do not need to install a separate package manager merely to demonstrate that Python can run. If your environment is already managed consistently through Homebrew, maintaining Python there can make sense. Otherwise, the python.org installer avoids adding another layer for a first installation.

Do not mix several installation methods without understanding which one controls the project.

Linux: do not replace the system Python casually

Many distributions include Python because operating-system tools depend on it. That changes the decision compared with Windows and macOS.

Check first:

python3 --version

Use your distribution documentation and package manager for system packages.

Common examples include:

Ubuntu/Debian:

sudo apt update
sudo apt install python3 python3-venv

Fedora:

sudo dnf install python3

Arch Linux:

sudo pacman -S python

Package names and policies vary by distribution and release. Verify the documentation for your distribution instead of copying a command from a different Linux family.

Do not manually replace /usr/bin/python3 with another interpreter simply to “upgrade Python.” If a project requires another version, use an appropriate isolated environment or version-management workflow without breaking system dependencies.

Create a virtual environment for the project

Once an appropriate interpreter exists, create a project directory and a virtual environment.

Windows:

py -m venv .venv
.venv\Scripts\activate

macOS/Linux:

python3 -m venv .venv
source .venv/bin/activate

Then check:

python --version

Inside an activated environment, python should point to that environment's interpreter.

The official venv documentation treats virtual environments as recreatable state rather than portable folders to copy from machine to machine.

Do not install every package globally

Inside the activated environment, install a dependency with:

python -m pip install requests

Invoking pip through the interpreter helps make clear which Python receives the package.

Before installing a package, confirm that you actually need it and that its name matches the intended project. Package ecosystems can contain names designed to resemble popular dependencies, so copying an incorrect name can install something different from what you expected.

pip, venv, and uv solve different problems

  • Python is the interpreter.
  • venv creates an isolated environment.
  • pip installs packages into an environment.
  • uv can manage projects, environments, dependencies, and Python versions through a different workflow.

If you want to explore uv, Crezendo maintains a separate guide on what uv is in Python. You do not need it for your first Python exercise.

Verify with a real file

Create hello.py:

from pathlib import Path
import sys

print("Python works")
print(sys.version)
print(sys.executable)
print(Path.cwd())

Run it.

Windows:

py hello.py

or inside an activated environment:

python hello.py

macOS/Linux:

python3 hello.py

or inside the environment:

python hello.py

This proves more than a version number: you know which executable works, which directory you are in, and which runtime executes the file.

When several Python versions are installed

Multiple versions are not automatically a problem. The problem is not knowing which one each command uses.

Check:

  • py --list when supported by the Windows manager;
  • where python or where py on Windows;
  • which python3 and which python on macOS/Linux;
  • sys.executable from inside the program;
  • the interpreter selected by your editor or IDE.

Do not remove installations at random until you know which projects or tools use them.

Which version should you install?

For a first learning project, choose a stable, supported Python release compatible with your operating system. For an existing project, use the version declared by that project.

This guide does not need to freeze one version number: Python releases new feature versions and maintenance updates over time. Check python.org/downloads and the project documentation on the day you install it.

Common problems

“Python is not recognized as a command”

Open a fresh terminal and inspect py, python, and installed paths before repeatedly reinstalling Python.

pip installs into another Python

Run:

python -m pip --version

to inspect the associated path.

Linux refuses a global package install

Do not automatically solve this with sudo pip. Create a virtual environment and follow the distribution's package-management policy.

The editor uses another version

Select the project interpreter explicitly and check sys.executable from its integrated terminal.

A tutorial asks for another Python version

Verify whether that requirement is real. When it is, install or select that version without unnecessarily replacing runtimes used by other projects.

After installation: learn the language

Installing Python only prepares the environment. Continue with Python for beginners: a practical path for variables, decisions, loops, collections, functions, files, exceptions, and a first project.

Crezendo maintains programming training areas, but this page does not announce a permanent cohort or an installation service. Review the current workshops or contact Crezendo with your operating system, objective, and previous experience.

Final checklist

  • I know which Python version the project requires;
  • I used an official source or my distribution package manager;
  • I know which command starts Python;
  • I checked sys.executable;
  • I created a virtual environment when the project needs one;
  • I installed dependencies inside that environment;
  • I ran a real .py file;
  • I documented the steps required to reproduce the environment.

A correct installation is not the one that leaves the most commands on PATH; it is the one that lets you know exactly which Python runs your project and rebuild that environment later.

Does your company need to solve this challenge?

Crezendo designs tailored workshops for companies, NGOs, and government bodies. Explore everything we can do for your organization or tell us what you need to receive a proposal and quote.

Request a proposal and quote View workshops for companies