How to Download and Install Python on Windows, macOS and Linux: Step-by-Step Guide
You can download Python for free from the official site python.org (Downloads section) or install it with one command using the uv manager: uv python install 3.15. On Windows, tick Add python.exe to PATH during setup; on macOS use the .pkg package from python.org or Homebrew; on Linux use your distribution's package manager or uv. Check the installation with python3 --version.
You can download Python for free from the official website python.org or install it with a single command using the uv manager. Below is a step-by-step installation for Windows, macOS and Linux, a version check, a tour of the interactive console REPL and the IDLE environment, and your first script. The whole process takes about ten minutes.
Where to download Python for free and safely
Python is free software, so you do not have to pay for it. There is one official source: the python.org website, Downloads section. It offers installers for Windows and macOS and the source code for building it yourself. Avoid third-party "Python builds" from file-sharing sites: you have no idea what has been added to them.
The second route, which most projects choose today, is the uv manager from Astral. It is a single tool that downloads the Python versions you need, creates virtual environments and installs libraries. It replaces the combination of pyenv, pip, venv, pipx and poetry and leaves the system Python untouched.
| Method | Pros | Best for |
|---|---|---|
| Installer from python.org | official, includes IDLE and documentation | beginners on Windows and macOS |
| uv | any version with one command, project environments, does not break the system | everyone, especially on Linux and for several projects |
| OS package manager (apt, dnf, brew) | familiar and updated together with the system | when the version in the repository is good enough |
Which Python version to choose
Install the latest stable version of Python 3. New versions come out every October, and at the time of writing this is Python 3.15. The Python 2 branch has been unsupported for a long time — instructions with print "hello" without parentheses are outdated.
The advice "take an older version, it is more proven" is a trap in practice: Python 3.10 stops receiving even security fixes in October 2026. Code written for 3.15 does not always run on older versions, while backward compatibility within Python 3 is good, so the latest version is almost always the best choice.
Installing Python on Windows
Using the installer from python.org
- Open python.org, go to the Downloads section and download the Windows installer (64-bit suits almost all computers).
- Run the file. On the first screen, be sure to tick Add python.exe to PATH — without it, the
pythoncommand will not be found in the terminal. - Click Install Now and wait until it finishes.
- Open a new PowerShell or Command Prompt window and check the version.
PS C:\Users\anna> python --version
Python 3.15.0
PS C:\Users\anna> py --list
-V:3.15 * Python 3.15 (64-bit)
The py command is the Python launcher for Windows: it knows about all installed versions and can run the one you need, for example py -3.15 script.py. In recent releases python.org also offers a new Python install manager for Windows; if you see it on the download page, follow the prompts — the principle is the same.
Installing Python with PowerShell
Without a browser, Python on Windows 10 and Windows 11 is easy to install with uv. First install uv itself with the official script, then the version you need:
PS> powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
PS> uv python install 3.15
PS> uv run --python 3.15 python --version
Python 3.15.0
Another option is the system package manager winget: winget search Python.Python shows the available versions, and winget install with the identifier you found installs the chosen one.
Common mistake: the Microsoft Store opens
If you type python and the Microsoft Store opens instead of the interpreter, Python is not in PATH and the Windows placeholder has triggered. Reinstall Python with the Add python.exe to PATH option ticked, or turn off the placeholders in Settings → Apps → Advanced app settings → App execution aliases. After changing PATH, always open a new terminal window.
Installing Python on macOS
On macOS the python3 command may already respond — it is either the system version or a placeholder from the Xcode developer tools, and it is usually outdated. For learning, install a recent version in one of these ways:
- Package from python.org — download the macOS installer (a
.pkgfile, universal for Intel and Apple Silicon) and go through the setup wizard. IDLE is installed together with Python. - Homebrew — if you have it:
brew install python. - uv — with the official script and the command to install a version.
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ uv python install 3.15
$ uv run --python 3.15 python --version
Python 3.15.0
On macOS and Linux use the python3 command: the name python may be missing there or point to a different program.
Installing Python on Linux: Ubuntu, Debian and others
On Linux Python is almost always already installed, but it is the system interpreter: the OS utilities run on it, and its version lags behind by a couple of years. Ubuntu 24.04 ships with Python 3.12, Debian 12 with 3.11. Do not upgrade or remove the system Python — you can break the package manager.
If the version from the repository is enough, install it together with the environment module and pip:
$ sudo apt update
$ sudo apt install python3 python3-venv python3-pip
$ python3 --version
Python 3.12.3
On Fedora and RHEL-like systems the same is done with sudo dnf install python3. For a fresh version alongside the system one, uv is the most convenient: it puts the interpreter in its own folder in your home directory and changes nothing in the system.
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ uv python install 3.15
$ uv python find 3.15
/home/lena/.local/share/uv/python/cpython-3.15.0/bin/python3.15
Why you should not run sudo pip install
Installing libraries with sudo pip install into the system Python is a short path to a broken apt. That is why, under PEP 668, modern distributions block such installs with the externally-managed-environment error. The right way is a project virtual environment, described below.
How to check the Python installation
After installing, open a new terminal and run a check. Commands for different systems:
| Task | Windows | macOS / Linux |
|---|---|---|
| Python version | python --version or py --version | python3 --version |
| Where the interpreter is | where python | which python3 |
| pip version | py -m pip --version | python3 -m pip --version |
| Version from inside Python | import sys; print(sys.version) | import sys; print(sys.version) |
"python" and "python3" are different programs
A classic first-day story: someone installs a fresh Python, writes code with new features and gets a SyntaxError. It turns out the terminal ran an old version — on one machine there can be three or four of them. Check the path with which python3 (or where python on Windows), and in projects run code through uv run, which always picks the version the project specifies.
How to update Python
Python is not upgraded "in place" between minor versions: 3.14 and 3.15 live side by side as separate programs. To update Python, install the new version the same way you did before — with the python.org installer, brew upgrade python or uv python install 3.15 — and then recreate the project virtual environments on the new version. Fixes within one version (3.15.0 → 3.15.1) are installed over the old one by the python.org installer.
REPL: the interactive Python console
The fastest way to try Python is the interactive console, or REPL (Read–Eval–Print Loop: read, evaluate, print, repeat). Start the interpreter without a file and it shows the >>> prompt:
$ python3
Python 3.15.0 ...
>>> 2 + 3
5
>>> name = "coffee"
>>> name.upper()
'COFFEE'
>>> exit
You can leave with the exit command or with Ctrl+D (on Windows, Ctrl+Z and then Enter). Since version 3.13 the console has become noticeably more convenient: a coloured prompt and tracebacks, editing of whole multi-line blocks, F1 for help, F2 for history, F3 for paste mode, and exit and quit work without parentheses. Version 3.14 added syntax highlighting while typing and Tab completion of module names after import. To go back to the plain console, set the environment variable PYTHON_BASIC_REPL=1.
IDLE: a simple environment included with Python
The python.org installers for Windows and macOS include IDLE, a small editor with a console. Find it in the Start menu or in the Programs list (the Python 3.15 folder). IDLE has two windows: Shell, which is the same >>> console, and the file editor: File → New File, write code, save it and press F5 (Run → Run Module) to execute it. On Linux IDLE is usually installed as a separate package; on Debian and Ubuntu use sudo apt install idle3.
For the first few weeks IDLE is more than enough. When your projects grow, it is more convenient to switch to a full-featured editor such as VS Code or PyCharm, but the interpreter stays the same.
Your first Python script
The console is good for experiments, but programs are written in files. A script is an ordinary text file with the .py extension, which the interpreter runs from top to bottom. Create a file called expenses.py:
item = "coffee"
amount = 250
print(item, amount)
Run it from the folder where the file is:
$ python3 expenses.py
coffee 250
On Windows the command is python expenses.py or py expenses.py, and with uv it is uv run expenses.py. If you see can't open file, you are in the wrong folder: switch to the right one with cd.
A project with a virtual environment
A virtual environment is an isolated .venv folder with its own Python and libraries, so that the dependencies of one project do not interfere with others. With uv a project is created with one command:
$ uv init expenses --python 3.15
Initialized project `expenses`
$ cd expenses && ls -a
.python-version README.md main.py pyproject.toml
$ uv run main.py
Hello from expenses!
pyproject.toml is the project's passport, .python-version pins the version, and uv creates .venv on the first run. Without uv, the environment is made with the standard module: python3 -m venv .venv, then activation with source .venv/bin/activate (on Windows, .venv\Scripts\activate) and installing libraries with pip install.
Common installation errors
| Symptom | Cause | What to do |
|---|---|---|
'python' is not recognized on Windows | Python was not added to PATH | reinstall with Add python.exe to PATH ticked, or run it through py |
python3: command not found on Linux | Python is not installed (minimal image, container) | sudo apt install python3 or uv |
No module named pip | pip was not installed together with Python | python3 -m ensurepip --upgrade or the python3-pip package |
externally-managed-environment | attempt to install libraries into the system Python (PEP 668) | create a virtual environment and install packages there |
| the version is old after installation | the terminal was opened before the installation, or another Python comes first in PATH | open a new terminal and check which python3 or where python |
Almost all installation problems come down to two things: PATH and confusion between several versions. If you are not sure which interpreter is running, run python3 -c "import sys; print(sys.executable)" — the command prints its full path.
Summary
The safest way to get Python is from python.org or with uv; on Windows do not forget the PATH checkbox, and on Linux leave the system interpreter alone. After installing, check the version, try the REPL and IDLE and run your first script — then you can move on to variables, strings and conditions. Installing Python 3.15, working with the console and your first project through uv are covered in practice in the first lecture of the course.
FAQ
Is Python paid?
No, Python is free and distributed under the PSF licence, and you can use it in commercial projects too.
Do I need to uninstall the old version of Python before installing a new one?
No, different versions live side by side without problems. On Linux and macOS you must never remove the system Python — OS utilities depend on it.
Can I install Python without administrator rights?
Yes: the python.org installer on Windows can install Python for the current user only, and uv always puts the interpreter in your home directory.
What if the python command is not found?
Python is not in PATH: reinstall it with Add python.exe to PATH ticked, or run it via py on Windows and python3 on macOS and Linux, then open a new terminal.
How much disk space does Python take up?
The interpreter with the standard library takes roughly a hundred megabytes; most of the space is later taken by libraries in virtual environments.
This topic is covered in depth with practice in the course “Python 3.15: от новичка до профи”.
Go to course