How to Install Python on Windows, Linux and macOS (2026)
Step-by-step Python 3.13 installation for Windows, Linux (apt, dnf, pacman), and macOS (Homebrew, official installer). Covers PATH setup and version verification.
Python 3.13 is the current stable release as of 2026, and installing it takes under five minutes on any operating system. This guide covers Windows, Linux, and macOS with exact commands you can copy-paste.
Check Whether Python is Already Installed
Before downloading anything, check what you already have. Open a terminal (Command Prompt on Windows, Terminal on macOS/Linux) and run:
python3 --version
If you see output like Python 3.12.3 or Python 3.13.3, you already have a working installation. On Windows, try python --version as well, since the command name differs depending on how Python was installed.
Windows also ships a py launcher. Try:
py --version
If any of these return a version number in the 3.x range, you can skip straight to writing code. If the command is not found, follow the installation steps for your OS below.
Installing Python on Windows
Windows does not ship Python by default. Two installation paths are common.
Option 1: The python.org Installer (Recommended)
- Visit the Python downloads page and download the latest Windows installer (64-bit).
- Run the
.exefile. - On the first screen, tick the checkbox labelled Add python.exe to PATH. This is the single most important step. Missing it causes the “python is not recognized” error that sends thousands of students to Stack Overflow every semester.
- Click Install Now for the default configuration.
- After installation completes, open a new Command Prompt window and verify:
python --version
You should see Python 3.13.x (the exact patch number depends on when you download).
Option 2: Microsoft Store
Search “Python 3.13” in the Microsoft Store and click Install. The Store version auto-updates and registers the python3 command automatically. It works well for learning, but runs inside an app sandbox that occasionally blocks file writes to certain directories. For placement-prep coding practice, either option works fine.
The py Launcher
Both installation methods register the py launcher. It lets you run specific versions side by side:
py -3.13 --version
py -3.12 --version
Useful when campus lab machines have an older Python and you have installed a newer one alongside it.
Installing Python on Linux
Most Linux distributions ship Python 3, but the version varies.
Ubuntu / Debian (apt)
Ubuntu 24.04 LTS ships Python 3.12. To install the latest 3.13, add the deadsnakes PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.13
Verify:
python3.13 --version
If 3.12 is sufficient for your coursework (it covers every placement-prep topic), the system default works without any changes:
python3 --version
# Python 3.12.3 on a fresh Ubuntu 24.04 install
Fedora (dnf)
Fedora typically ships a recent Python. Install or update with:
sudo dnf install python3
Arch Linux (pacman)
sudo pacman -S python
Arch rolling-release means you will usually get the latest stable Python within days of its release.
pyenv (Any Distribution)
For students who need multiple Python versions (say, 3.12 for a college lab project and 3.13 for personal work):
curl https://pyenv.run | bash
pyenv install 3.13.3
pyenv global 3.13.3
pyenv compiles Python from source, so you will need build dependencies (build-essential, libssl-dev, libffi-dev, etc.).
Installing Python on macOS
Apple stopped shipping a usable system Python years ago. The /usr/bin/python3 stub on recent macOS versions prompts you to install Xcode Command Line Tools, which gives you a somewhat outdated Python. Better options exist.
Option 1: Homebrew (Recommended)
If you do not have Homebrew, install it first from brew.sh. Then:
brew install [email protected]
Homebrew links python3 and pip3 into your PATH automatically. Verify:
python3 --version
See the Homebrew Python formula for configuration details.
Option 2: Official Installer
Download the macOS .pkg from python.org/downloads. Run the installer, follow the prompts. It installs into /Library/Frameworks/Python.framework/ and adds python3 to your PATH.
pyenv on macOS
Works identically to Linux:
brew install pyenv
pyenv install 3.13.3
pyenv global 3.13.3
Common Installation Problems and Fixes
| Problem | OS | Fix |
|---|---|---|
python is not recognized | Windows | Re-run installer, tick Add to PATH, or use py launcher |
pip: command not found | All | Use python3 -m pip instead of bare pip |
externally managed environment error | Ubuntu 24.04 | Create a virtual environment first: python3 -m venv myenv |
Wrong version runs when typing python3 | macOS/Linux | Check which python3; adjust PATH order or use pyenv |
| Permission denied during install | Linux | Use sudo for system installs, or install to user space via pyenv |
The “externally managed environment” message on Ubuntu 24.04 is new and catches many students off-guard. It means the system Python is protected from accidental pip install commands that could break OS packages. The fix is simple: always work inside a virtual environment.
python3 -m venv ~/my-project-env
source ~/my-project-env/bin/activate
pip install requests # works inside the venv
What to Do After Installing Python
With Python verified, try the interactive REPL:
python3
Type print("Hello, placement prep") and press Enter. If it prints back, your setup is complete.
From here, pick a beginner program and run it locally. A calculator program in Python or a greatest of three numbers in Python are standard first exercises. For a structured set, see the Python basic programs for practice collection.
For an editor, VS Code with the Python extension is free, lightweight, and handles everything from 10-line scripts to full Django projects. PyCharm Community Edition is another solid option if you prefer an all-in-one IDE.
Running Python Without Local Installation
Local setup is worth learning once, but it is not always convenient. Campus Wi-Fi blocking downloads, locked lab machines, or a Chromebook with no admin access are real constraints. TinkerLLM runs Python and LLM experiments directly in your browser at ₹299, no installer required. If the five-minute setup above gave you trouble, or you want to jump straight into AI experiments without configuring virtual environments, that is a practical alternative.
Primary sources
Frequently asked questions
Do I need to uninstall Python 2 before installing Python 3?
No. Python 2 and Python 3 coexist without conflict. On most systems, they use separate commands (python vs python3). Python 2 reached end-of-life in January 2020, so you can safely remove it if you want to reclaim disk space, but it will not interfere with Python 3.
Why does Windows say python is not recognized as an internal command?
The installer did not add Python to your system PATH. Re-run the installer, choose Modify, and tick the Add to PATH option. Alternatively, use the py launcher which registers itself separately and works even without PATH configuration.
Can I have multiple Python versions installed at the same time?
Yes. On Windows, the py launcher lets you switch between versions with py -3.12 or py -3.13. On Linux and macOS, pyenv manages multiple versions cleanly. Most package managers also support parallel installs (e.g., python3.12 and python3.13 as separate binaries).
Is the Microsoft Store version of Python the same as the python.org version?
It is the same CPython interpreter, packaged by the Python core team for the Microsoft Store. The main difference is sandboxing: the Store version runs in an app container, which can cause permission issues with certain filesystem paths. For development work, the python.org installer gives fewer surprises.
What is the difference between python and python3 commands on Linux?
On most modern Linux distributions, python3 points to the system Python 3 installation. The bare python command may not exist at all, or it may point to Python 2 on older distributions. Always use python3 explicitly unless you have configured an alias or are using a virtual environment.
A self-paced playground for building with LLMs.
TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.
Try TinkerLLM (₹299 launch)