Before installing Python you have two decisions: which version, and which build. Get both right and installation is uneventful. Get either wrong and you spend an afternoon on PATH problems or a package that will not install. This guide covers the choice; the step-by-step install is a separate page.
Which version#
Default: the latest stable Python 3 release. Each version receives five years of support, so a current one will be maintained far longer than any project you start today.
Pick one release older if a library you depend on has not published wheels for the newest version yet. This happens for a few months after each release, particularly for scientific packages with compiled components. The symptom is pip trying to build from source and failing for want of a C compiler.
Match an existing project if you are joining one. Look for a .python-version file, a requires-python line in pyproject.toml, or the version in its CI configuration.
Where to download from#
| Platform | Recommended | Also fine |
|---|---|---|
| Windows | python.org installer | winget install Python.Python.3.12 |
| macOS | python.org installer | brew install [email protected] |
| Linux | your package manager | pyenv, for several versions |
| Data science, any platform | Miniconda | Anaconda, if you want the full bundle |
sudo apt install python3 python3-pip python3-venv # Debian and Ubuntu
sudo dnf install python3 python3-pip # Fedora
On Debian and Ubuntu, install python3-venv as well. It is packaged separately, and without it the built-in virtual environment command fails with a confusing message about ensurepip.
The Windows Store build#
Typing python on a clean Windows install opens the Microsoft Store rather than reporting that nothing is installed — which is genuinely confusing when you are trying to diagnose a PATH problem.
The Store version installs without administrator rights, which is useful on a locked-down machine. Two things make it a poorer default:
- It redirects file writes into a per-user virtualised folder, so some tools that expect a conventional layout behave oddly.
- The stub aliases interfere with diagnosing PATH issues.
Turn the stubs off in Settings, under App execution aliases, and use the python.org installer unless you cannot.
The macOS system Python#
which python3
# /usr/bin/python3 <- the system one, do not use it
macOS ships a Python for its own internal use. It is often an old version, and installing packages into it can interfere with system tooling. Install your own from python.org or Homebrew, and check you are using it:
which -a python3
python3 --version
Homebrew’s Python is also marked as externally managed, so a global pip install is refused by design. That refusal is correct — the answer is a virtual environment, not the flag that overrides it.
32-bit or 64-bit#
64-bit, unless you have a specific reason. The 32-bit build is limited to about 4 GB of memory, which is a real constraint for any data work, and some packages no longer publish 32-bit wheels at all.
python -c "import platform; print(platform.architecture()[0])"
Verifying the download#
The python.org download page publishes a checksum for every file. Comparing it takes ten seconds and confirms the file arrived intact and unmodified:
Get-FileHash python-3.12.4-amd64.exe -Algorithm SHA256
shasum -a 256 python-3.12.4-macos11.pkg # macOS
sha256sum python-3.12.4.tgz # Linux
Download from python.org itself, over HTTPS. Search results for “python download” include advertisements and mirrors of varying provenance, and an interpreter is about as trusted a piece of software as you can install.
Anaconda or plain Python#
| python.org | Miniconda | Anaconda | |
|---|---|---|---|
| Download size | around 30 MB | around 100 MB | several GB |
| Package manager | pip | conda and pip | conda and pip |
| Non-Python dependencies | no | yes | yes |
| Best for | general use | data science | a ready-made bundle |
Conda earns its place when you need libraries with non-Python dependencies that pip struggles with — some geospatial, scientific and GPU packages. For general programming it is a large download solving a problem you do not have.
Miniconda gives you conda without several gigabytes of preinstalled packages, which is usually the better starting point.
Several versions at once#
Perfectly normal, and each project pins its own with a virtual environment.
py --list # Windows, shows every installed version
py -3.11 -m venv .venv
brew install pyenv # macOS and Linux
pyenv install 3.12.4
pyenv local 3.12.4 # writes .python-version for this folder
pyenv compiles Python from source, so on Linux install the build dependencies first — otherwise you get an interpreter missing optional modules such as lzma and sqlite3, and the failure appears much later.
sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev libffi-dev liblzma-dev
After downloading#
Three commands confirm everything landed correctly:
python --version
python -m pip --version
python -c "import sys; print(sys.executable)"
That third line is the one worth remembering. It prints the exact interpreter running, which is the answer to almost every “I installed it but the import fails” problem you will meet later.
Questions people ask#
Is Python free?
Yes, entirely, for any use including commercial. It is open source under a permissive licence.
Do I need to uninstall an old version first?
No. Several versions coexist happily, and virtual environments keep projects pinned to the one they need.
How big is the download?
Around 25 to 30 MB for the python.org installer, expanding to roughly 100 MB installed. Anaconda is several gigabytes.
What is the difference between the installer and the source tarball?
The installer is prebuilt and ready to run. The source tarball has to be compiled, which takes several minutes and requires build tools — only worth it if you need a custom build.
Where to go next#
- Downloading and installing Python — the step-by-step install and first run.
- Choosing a Python version for Windows — the Windows specifics in depth.
- Python virtual environments — the habit to form immediately.